UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

163 lines (162 loc) 7.14 kB
"use strict"; 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 RepresentationsApi_1 = require("./representations/RepresentationsApi"); var ContentprotectionApi_1 = require("./contentprotection/ContentprotectionApi"); var BitmovinResponse_1 = require("../../../models/BitmovinResponse"); var SmoothStreamingManifest_1 = require("../../../models/SmoothStreamingManifest"); var StartManifestRequest_1 = require("../../../models/StartManifestRequest"); var Task_1 = require("../../../models/Task"); var PaginationResponse_1 = require("../../../models/PaginationResponse"); var SmoothStreamingManifestListQueryParams_1 = require("./SmoothStreamingManifestListQueryParams"); /** * SmoothApi - object-oriented interface * @export * @class SmoothApi * @extends {BaseAPI} */ var SmoothApi = /** @class */ (function (_super) { __extends(SmoothApi, _super); function SmoothApi(configuration) { var _this = _super.call(this, configuration) || this; _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); return _this; } /** * @summary Create Smooth Streaming Manifest * @param {SmoothStreamingManifest} smoothStreamingManifest The Custom Smooth Streaming Manifest to be created. * @throws {BitmovinError} * @memberof SmoothApi */ SmoothApi.prototype.create = function (smoothStreamingManifest) { return this.restClient.post('/encoding/manifests/smooth', {}, smoothStreamingManifest).then(function (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 */ SmoothApi.prototype.delete = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.delete('/encoding/manifests/smooth/{manifest_id}', pathParamMap).then(function (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 */ SmoothApi.prototype.get = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/smooth/{manifest_id}', pathParamMap).then(function (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 */ SmoothApi.prototype.getStartRequest = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/start', pathParamMap).then(function (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 */ SmoothApi.prototype.list = function (queryParameters) { var 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(function (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 */ SmoothApi.prototype.start = function (manifestId, startManifestRequest) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.post('/encoding/manifests/smooth/{manifest_id}/start', pathParamMap, startManifestRequest).then(function (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 */ SmoothApi.prototype.status = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/status', pathParamMap).then(function (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 */ SmoothApi.prototype.stop = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.post('/encoding/manifests/smooth/{manifest_id}/stop', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); }; return SmoothApi; }(BaseAPI_1.BaseAPI)); exports.default = SmoothApi;