@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
161 lines (160 loc) • 6.6 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var BaseAPI_1 = require("../../../common/BaseAPI");
var Mapper_1 = require("../../../common/Mapper");
var DefaultApi_1 = require("./default/DefaultApi");
var CustomdataApi_1 = require("./customdata/CustomdataApi");
var PeriodsApi_1 = require("./periods/PeriodsApi");
var BitmovinResponse_1 = require("../../../models/BitmovinResponse");
var DashManifest_1 = require("../../../models/DashManifest");
var StartManifestRequest_1 = require("../../../models/StartManifestRequest");
var Task_1 = require("../../../models/Task");
var PaginationResponse_1 = require("../../../models/PaginationResponse");
var DashManifestListQueryParams_1 = require("./DashManifestListQueryParams");
/**
* DashApi - object-oriented interface
* @export
* @class DashApi
* @extends {BaseAPI}
*/
var DashApi = /** @class */ (function (_super) {
__extends(DashApi, _super);
function DashApi(configuration) {
var _this = _super.call(this, configuration) || this;
_this.default = new DefaultApi_1.default(configuration);
_this.customdata = new CustomdataApi_1.default(configuration);
_this.periods = new PeriodsApi_1.default(configuration);
return _this;
}
/**
* @summary Create Custom DASH Manifest
* @param {DashManifest} dashManifest The Custom DASH Manifest to be created.
* @throws {BitmovinError}
* @memberof DashApi
*/
DashApi.prototype.create = function (dashManifest) {
return this.restClient.post('/encoding/manifests/dash', {}, dashManifest).then(function (response) {
return (0, Mapper_1.map)(response, DashManifest_1.default);
});
};
/**
* @summary Delete DASH Manifest
* @param {string} manifestId UUID of the DASH Manifest to be deleted
* @throws {BitmovinError}
* @memberof DashApi
*/
DashApi.prototype.delete = function (manifestId) {
var pathParamMap = {
manifest_id: manifestId
};
return this.restClient.delete('/encoding/manifests/dash/{manifest_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary DASH Manifest Details
* @param {string} manifestId UUID of the DASH Manifest
* @throws {BitmovinError}
* @memberof DashApi
*/
DashApi.prototype.get = function (manifestId) {
var pathParamMap = {
manifest_id: manifestId
};
return this.restClient.get('/encoding/manifests/dash/{manifest_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, DashManifest_1.default);
});
};
/**
* @summary Manifest Start Details
* @param {string} manifestId Id of the manifest
* @throws {BitmovinError}
* @memberof DashApi
*/
DashApi.prototype.getStartRequest = function (manifestId) {
var pathParamMap = {
manifest_id: manifestId
};
return this.restClient.get('/encoding/manifests/dash/{manifest_id}/start', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, StartManifestRequest_1.default);
});
};
/**
* @summary List DASH Manifests
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof DashApi
*/
DashApi.prototype.list = function (queryParameters) {
var queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new DashManifestListQueryParams_1.DashManifestListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/manifests/dash', {}, queryParams).then(function (response) {
return new PaginationResponse_1.default(response, DashManifest_1.default);
});
};
/**
* @summary Start DASH manifest generation
* @param {string} manifestId Id of the DASH Manifest.
* @param {StartManifestRequest} [startManifestRequest] Manifest Startup Options
* @throws {BitmovinError}
* @memberof DashApi
*/
DashApi.prototype.start = function (manifestId, startManifestRequest) {
var pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/encoding/manifests/dash/{manifest_id}/start', pathParamMap, startManifestRequest).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary DASH manifest generation status
* @param {string} manifestId Id of the DASH Manifest.
* @throws {BitmovinError}
* @memberof DashApi
*/
DashApi.prototype.status = function (manifestId) {
var pathParamMap = {
manifest_id: manifestId
};
return this.restClient.get('/encoding/manifests/dash/{manifest_id}/status', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, Task_1.default);
});
};
/**
* @summary Stop DASH manifest generation
* @param {string} manifestId Id of the DASH Manifest.
* @throws {BitmovinError}
* @memberof DashApi
*/
DashApi.prototype.stop = function (manifestId) {
var pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/encoding/manifests/dash/{manifest_id}/stop', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
return DashApi;
}(BaseAPI_1.BaseAPI));
exports.default = DashApi;