@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
90 lines (89 loc) • 3.94 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 SmoothStreamingRepresentation_1 = require("../../../../../models/SmoothStreamingRepresentation");
const PaginationResponse_1 = require("../../../../../models/PaginationResponse");
const SmoothStreamingRepresentationListQueryParams_1 = require("./SmoothStreamingRepresentationListQueryParams");
/**
* Mp4Api - object-oriented interface
* @export
* @class Mp4Api
* @extends {BaseAPI}
*/
class Mp4Api extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @summary Add MP4 Representation to Smooth Streaming Manifest
* @param {string} manifestId Id of the Smooth Streaming manifest.
* @param {SmoothStreamingRepresentation} smoothStreamingRepresentation The MP4 Representation to be added
* @throws {BitmovinError}
* @memberof Mp4Api
*/
create(manifestId, smoothStreamingRepresentation) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/encoding/manifests/smooth/{manifest_id}/representations/mp4', pathParamMap, smoothStreamingRepresentation).then((response) => {
return (0, Mapper_1.map)(response, SmoothStreamingRepresentation_1.default);
});
}
/**
* @summary Delete Smooth Streaming MP4 Representation
* @param {string} manifestId Id of the Smooth Streaming manifest.
* @param {string} representationId Id of the MP4 representation.
* @throws {BitmovinError}
* @memberof Mp4Api
*/
delete(manifestId, representationId) {
const pathParamMap = {
manifest_id: manifestId,
representation_id: representationId
};
return this.restClient.delete('/encoding/manifests/smooth/{manifest_id}/representations/mp4/{representation_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary Smooth Streaming MP4 Representation Details
* @param {string} manifestId Id of the Smooth Streaming manifest.
* @param {string} representationId Id of the MP4 representation.
* @throws {BitmovinError}
* @memberof Mp4Api
*/
get(manifestId, representationId) {
const pathParamMap = {
manifest_id: manifestId,
representation_id: representationId
};
return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/representations/mp4/{representation_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, SmoothStreamingRepresentation_1.default);
});
}
/**
* @summary List MP4 Representation
* @param {string} manifestId Id of the Smooth Streaming manifest.
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof Mp4Api
*/
list(manifestId, queryParameters) {
const pathParamMap = {
manifest_id: manifestId
};
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new SmoothStreamingRepresentationListQueryParams_1.SmoothStreamingRepresentationListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/representations/mp4', pathParamMap, queryParams).then((response) => {
return new PaginationResponse_1.default(response, SmoothStreamingRepresentation_1.default);
});
}
}
exports.default = Mp4Api;