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