@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
145 lines (144 loc) • 5.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../../common/BaseAPI");
const Mapper_1 = require("../../../common/Mapper");
const DefaultApi_1 = require("./default/DefaultApi");
const CustomdataApi_1 = require("./customdata/CustomdataApi");
const RepresentationsApi_1 = require("./representations/RepresentationsApi");
const ContentprotectionApi_1 = require("./contentprotection/ContentprotectionApi");
const BitmovinResponse_1 = require("../../../models/BitmovinResponse");
const SmoothStreamingManifest_1 = require("../../../models/SmoothStreamingManifest");
const StartManifestRequest_1 = require("../../../models/StartManifestRequest");
const Task_1 = require("../../../models/Task");
const PaginationResponse_1 = require("../../../models/PaginationResponse");
const SmoothStreamingManifestListQueryParams_1 = require("./SmoothStreamingManifestListQueryParams");
/**
* SmoothApi - object-oriented interface
* @export
* @class SmoothApi
* @extends {BaseAPI}
*/
class SmoothApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
this.default = new DefaultApi_1.default(configuration);
this.customdata = new CustomdataApi_1.default(configuration);
this.representations = new RepresentationsApi_1.default(configuration);
this.contentprotection = new ContentprotectionApi_1.default(configuration);
}
/**
* @summary Create Smooth Streaming Manifest
* @param {SmoothStreamingManifest} smoothStreamingManifest The Custom Smooth Streaming Manifest to be created.
* @throws {BitmovinError}
* @memberof SmoothApi
*/
create(smoothStreamingManifest) {
return this.restClient.post('/encoding/manifests/smooth', {}, smoothStreamingManifest).then((response) => {
return (0, Mapper_1.map)(response, SmoothStreamingManifest_1.default);
});
}
/**
* @summary Delete Smooth Streaming Manifest
* @param {string} manifestId Id of the Smooth Streaming Manifest.
* @throws {BitmovinError}
* @memberof SmoothApi
*/
delete(manifestId) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.delete('/encoding/manifests/smooth/{manifest_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary Smooth Streaming Manifest Details
* @param {string} manifestId Id of the Smooth Streaming Manifest.
* @throws {BitmovinError}
* @memberof SmoothApi
*/
get(manifestId) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.get('/encoding/manifests/smooth/{manifest_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, SmoothStreamingManifest_1.default);
});
}
/**
* @summary Manifest Start Details
* @param {string} manifestId Id of the manifest
* @throws {BitmovinError}
* @memberof SmoothApi
*/
getStartRequest(manifestId) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/start', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, StartManifestRequest_1.default);
});
}
/**
* @summary List Smooth Streaming Manifests
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof SmoothApi
*/
list(queryParameters) {
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new SmoothStreamingManifestListQueryParams_1.SmoothStreamingManifestListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/manifests/smooth', {}, queryParams).then((response) => {
return new PaginationResponse_1.default(response, SmoothStreamingManifest_1.default);
});
}
/**
* @summary Start Smooth Streaming manifest generation
* @param {string} manifestId Id of the Smooth Streaming Manifest.
* @param {StartManifestRequest} [startManifestRequest] Manifest Startup Options
* @throws {BitmovinError}
* @memberof SmoothApi
*/
start(manifestId, startManifestRequest) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/encoding/manifests/smooth/{manifest_id}/start', pathParamMap, startManifestRequest).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary Smooth Streaming manifest generation status
* @param {string} manifestId Id of the Smooth Streaming Manifest.
* @throws {BitmovinError}
* @memberof SmoothApi
*/
status(manifestId) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/status', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, Task_1.default);
});
}
/**
* @summary Stop Smooth Streaming manifest generation
* @param {string} manifestId Id of the Smooth Streaming Manifest.
* @throws {BitmovinError}
* @memberof SmoothApi
*/
stop(manifestId) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/encoding/manifests/smooth/{manifest_id}/stop', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
}
exports.default = SmoothApi;