UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

107 lines (106 loc) 4.93 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 BitmovinResponse_1 = require("../../../../../models/BitmovinResponse"); var SmoothStreamingRepresentation_1 = require("../../../../../models/SmoothStreamingRepresentation"); var PaginationResponse_1 = require("../../../../../models/PaginationResponse"); var SmoothStreamingRepresentationListQueryParams_1 = require("./SmoothStreamingRepresentationListQueryParams"); /** * Mp4Api - object-oriented interface * @export * @class Mp4Api * @extends {BaseAPI} */ var Mp4Api = /** @class */ (function (_super) { __extends(Mp4Api, _super); function Mp4Api(configuration) { return _super.call(this, configuration) || this; } /** * @summary Add MP4 Representation to Smooth Streaming Manifest * @param {string} manifestId Id of the Smooth Streaming manifest. * @param {SmoothStreamingRepresentation} smoothStreamingRepresentation The MP4 Representation to be added * @throws {BitmovinError} * @memberof Mp4Api */ Mp4Api.prototype.create = function (manifestId, smoothStreamingRepresentation) { var pathParamMap = { manifest_id: manifestId }; return this.restClient.post('/encoding/manifests/smooth/{manifest_id}/representations/mp4', pathParamMap, smoothStreamingRepresentation).then(function (response) { return (0, Mapper_1.map)(response, SmoothStreamingRepresentation_1.default); }); }; /** * @summary Delete Smooth Streaming MP4 Representation * @param {string} manifestId Id of the Smooth Streaming manifest. * @param {string} representationId Id of the MP4 representation. * @throws {BitmovinError} * @memberof Mp4Api */ Mp4Api.prototype.delete = function (manifestId, representationId) { var pathParamMap = { manifest_id: manifestId, representation_id: representationId }; return this.restClient.delete('/encoding/manifests/smooth/{manifest_id}/representations/mp4/{representation_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); }; /** * @summary Smooth Streaming MP4 Representation Details * @param {string} manifestId Id of the Smooth Streaming manifest. * @param {string} representationId Id of the MP4 representation. * @throws {BitmovinError} * @memberof Mp4Api */ Mp4Api.prototype.get = function (manifestId, representationId) { var pathParamMap = { manifest_id: manifestId, representation_id: representationId }; return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/representations/mp4/{representation_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, SmoothStreamingRepresentation_1.default); }); }; /** * @summary List MP4 Representation * @param {string} manifestId Id of the Smooth Streaming manifest. * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof Mp4Api */ Mp4Api.prototype.list = function (manifestId, queryParameters) { var pathParamMap = { manifest_id: manifestId }; var queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new SmoothStreamingRepresentationListQueryParams_1.SmoothStreamingRepresentationListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/representations/mp4', pathParamMap, queryParams).then(function (response) { return new PaginationResponse_1.default(response, SmoothStreamingRepresentation_1.default); }); }; return Mp4Api; }(BaseAPI_1.BaseAPI)); exports.default = Mp4Api;