UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

143 lines (142 loc) 5.43 kB
"use strict"; 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 PeriodsApi_1 = require("./periods/PeriodsApi"); const BitmovinResponse_1 = require("../../../models/BitmovinResponse"); const DashManifest_1 = require("../../../models/DashManifest"); const StartManifestRequest_1 = require("../../../models/StartManifestRequest"); const Task_1 = require("../../../models/Task"); const PaginationResponse_1 = require("../../../models/PaginationResponse"); const DashManifestListQueryParams_1 = require("./DashManifestListQueryParams"); /** * DashApi - object-oriented interface * @export * @class DashApi * @extends {BaseAPI} */ class DashApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); this.default = new DefaultApi_1.default(configuration); this.customdata = new CustomdataApi_1.default(configuration); this.periods = new PeriodsApi_1.default(configuration); } /** * @summary Create Custom DASH Manifest * @param {DashManifest} dashManifest The Custom DASH Manifest to be created. * @throws {BitmovinError} * @memberof DashApi */ create(dashManifest) { return this.restClient.post('/encoding/manifests/dash', {}, dashManifest).then((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 */ delete(manifestId) { const pathParamMap = { manifest_id: manifestId }; return this.restClient.delete('/encoding/manifests/dash/{manifest_id}', pathParamMap).then((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 */ get(manifestId) { const pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/dash/{manifest_id}', pathParamMap).then((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 */ getStartRequest(manifestId) { const pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/dash/{manifest_id}/start', pathParamMap).then((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 */ list(queryParameters) { let 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((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 */ start(manifestId, startManifestRequest) { const pathParamMap = { manifest_id: manifestId }; return this.restClient.post('/encoding/manifests/dash/{manifest_id}/start', pathParamMap, startManifestRequest).then((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 */ status(manifestId) { const pathParamMap = { manifest_id: manifestId }; return this.restClient.get('/encoding/manifests/dash/{manifest_id}/status', pathParamMap).then((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 */ stop(manifestId) { const pathParamMap = { manifest_id: manifestId }; return this.restClient.post('/encoding/manifests/dash/{manifest_id}/stop', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); } } exports.default = DashApi;