@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
92 lines (91 loc) • 3.47 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 MxfMuxing_1 = require("../../../../models/MxfMuxing");
const PaginationResponse_1 = require("../../../../models/PaginationResponse");
const MxfMuxingListQueryParams_1 = require("./MxfMuxingListQueryParams");
/**
* MxfApi - object-oriented interface
* @export
* @class MxfApi
* @extends {BaseAPI}
*/
class MxfApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
this.customdata = new CustomdataApi_1.default(configuration);
}
/**
* @summary Add MXF muxing
* @param {string} encodingId Id of the encoding.
* @param {MxfMuxing} mxfMuxing The MXF muxing to be created
* @throws {BitmovinError}
* @memberof MxfApi
*/
create(encodingId, mxfMuxing) {
const pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/encoding/encodings/{encoding_id}/muxings/mxf', pathParamMap, mxfMuxing).then((response) => {
return (0, Mapper_1.map)(response, MxfMuxing_1.default);
});
}
/**
* @summary Delete MXF muxing
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the MXF muxing
* @throws {BitmovinError}
* @memberof MxfApi
*/
delete(encodingId, muxingId) {
const pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId
};
return this.restClient.delete('/encoding/encodings/{encoding_id}/muxings/mxf/{muxing_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary MXF muxing details
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the MXF muxing
* @throws {BitmovinError}
* @memberof MxfApi
*/
get(encodingId, muxingId) {
const pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId
};
return this.restClient.get('/encoding/encodings/{encoding_id}/muxings/mxf/{muxing_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, MxfMuxing_1.default);
});
}
/**
* @summary List MXF muxings
* @param {string} encodingId Id of the encoding.
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof MxfApi
*/
list(encodingId, queryParameters) {
const pathParamMap = {
encoding_id: encodingId
};
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new MxfMuxingListQueryParams_1.MxfMuxingListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/encodings/{encoding_id}/muxings/mxf', pathParamMap, queryParams).then((response) => {
return new PaginationResponse_1.default(response, MxfMuxing_1.default);
});
}
}
exports.default = MxfApi;