UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

163 lines (162 loc) 6.63 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 StreamsApi_1 = require("./streams/StreamsApi"); var MediaApi_1 = require("./media/MediaApi"); var BitmovinResponse_1 = require("../../../models/BitmovinResponse"); var HlsManifest_1 = require("../../../models/HlsManifest"); var StartManifestRequest_1 = require("../../../models/StartManifestRequest"); var Task_1 = require("../../../models/Task"); var PaginationResponse_1 = require("../../../models/PaginationResponse"); var HlsManifestListQueryParams_1 = require("./HlsManifestListQueryParams"); /** * HlsApi - object-oriented interface * @export * @class HlsApi * @extends {BaseAPI} */ var HlsApi = /** @class */ (function (_super) { __extends(HlsApi, _super); function HlsApi(configuration) { var _this = _super.call(this, configuration) || this; _this.default = new DefaultApi_1.default(configuration); _this.customdata = new CustomdataApi_1.default(configuration); _this.streams = new StreamsApi_1.default(configuration); _this.media = new MediaApi_1.default(configuration); return _this; } /** * @summary Create Custom HLS Manifest * @param {HlsManifest} hlsManifest The Custom HLS Manifest to be created. * @throws {BitmovinError} * @memberof HlsApi */ HlsApi.prototype.create = function (hlsManifest) { return this.restClient.post('/encoding/manifests/hls', {}, hlsManifest).then(function (response) { return (0, Mapper_1.map)(response, HlsManifest_1.default); }); }; /** * @summary Delete HLS Manifest * @param {string} manifestId Id of the HLS Manifest. * @throws {BitmovinError} * @memberof HlsApi */ HlsApi.prototype.delete = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.delete('/encoding/manifests/hls/{manifest_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); }; /** * @summary HLS Manifest Details * @param {string} manifestId Id of the HLS Manifest. * @throws {BitmovinError} * @memberof HlsApi */ HlsApi.prototype.get = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/hls/{manifest_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, HlsManifest_1.default); }); }; /** * @summary Manifest Start Details * @param {string} manifestId ID of the manifest * @throws {BitmovinError} * @memberof HlsApi */ HlsApi.prototype.getStartRequest = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/hls/{manifest_id}/start', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, StartManifestRequest_1.default); }); }; /** * @summary List HLS Manifests * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof HlsApi */ HlsApi.prototype.list = function (queryParameters) { var queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new HlsManifestListQueryParams_1.HlsManifestListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/manifests/hls', {}, queryParams).then(function (response) { return new PaginationResponse_1.default(response, HlsManifest_1.default); }); }; /** * @summary Start HLS manifest generation * @param {string} manifestId Id of the HLS Manifest. * @param {StartManifestRequest} [startManifestRequest] Manifest Startup Options * @throws {BitmovinError} * @memberof HlsApi */ HlsApi.prototype.start = function (manifestId, startManifestRequest) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.post('/encoding/manifests/hls/{manifest_id}/start', pathParamMap, startManifestRequest).then(function (response) { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); }; /** * @summary HLS manifest generation status * @param {string} manifestId Id of the HLS Manifest. * @throws {BitmovinError} * @memberof HlsApi */ HlsApi.prototype.status = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/hls/{manifest_id}/status', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, Task_1.default); }); }; /** * @summary Stop HLS manifest generation * @param {string} manifestId Id of the HLS Manifest. * @throws {BitmovinError} * @memberof HlsApi */ HlsApi.prototype.stop = function (manifestId) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.post('/encoding/manifests/hls/{manifest_id}/stop', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); }; return HlsApi; }(BaseAPI_1.BaseAPI)); exports.default = HlsApi;