@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
96 lines (95 loc) • 4.1 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 InformationApi_1 = require("./information/InformationApi");
const DrmApi_1 = require("./drm/DrmApi");
const BitmovinResponse_1 = require("../../../../models/BitmovinResponse");
const ProgressiveWebmMuxing_1 = require("../../../../models/ProgressiveWebmMuxing");
const PaginationResponse_1 = require("../../../../models/PaginationResponse");
const ProgressiveWebmMuxingListQueryParams_1 = require("./ProgressiveWebmMuxingListQueryParams");
/**
* ProgressiveWebmApi - object-oriented interface
* @export
* @class ProgressiveWebmApi
* @extends {BaseAPI}
*/
class ProgressiveWebmApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
this.customdata = new CustomdataApi_1.default(configuration);
this.information = new InformationApi_1.default(configuration);
this.drm = new DrmApi_1.default(configuration);
}
/**
* @summary Add Progressive WebM muxing
* @param {string} encodingId Id of the encoding.
* @param {ProgressiveWebmMuxing} progressiveWebmMuxing The Progressive WebM muxing to be created
* @throws {BitmovinError}
* @memberof ProgressiveWebmApi
*/
create(encodingId, progressiveWebmMuxing) {
const pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/encoding/encodings/{encoding_id}/muxings/progressive-webm', pathParamMap, progressiveWebmMuxing).then((response) => {
return (0, Mapper_1.map)(response, ProgressiveWebmMuxing_1.default);
});
}
/**
* @summary Delete Progressive WebM muxing
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the Progressive WebM muxing
* @throws {BitmovinError}
* @memberof ProgressiveWebmApi
*/
delete(encodingId, muxingId) {
const pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId
};
return this.restClient.delete('/encoding/encodings/{encoding_id}/muxings/progressive-webm/{muxing_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary Progressive WebM muxing details
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the Progressive WebM muxing
* @throws {BitmovinError}
* @memberof ProgressiveWebmApi
*/
get(encodingId, muxingId) {
const pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId
};
return this.restClient.get('/encoding/encodings/{encoding_id}/muxings/progressive-webm/{muxing_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, ProgressiveWebmMuxing_1.default);
});
}
/**
* @summary List Progressive WebM muxings
* @param {string} encodingId Id of the encoding.
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof ProgressiveWebmApi
*/
list(encodingId, queryParameters) {
const pathParamMap = {
encoding_id: encodingId
};
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new ProgressiveWebmMuxingListQueryParams_1.ProgressiveWebmMuxingListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/encodings/{encoding_id}/muxings/progressive-webm', pathParamMap, queryParams).then((response) => {
return new PaginationResponse_1.default(response, ProgressiveWebmMuxing_1.default);
});
}
}
exports.default = ProgressiveWebmApi;