@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
107 lines (106 loc) • 5.14 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 BitmovinResponse_1 = require("../../../../models/BitmovinResponse");
var SmoothManifestContentProtection_1 = require("../../../../models/SmoothManifestContentProtection");
var PaginationResponse_1 = require("../../../../models/PaginationResponse");
var SmoothManifestContentProtectionListQueryParams_1 = require("./SmoothManifestContentProtectionListQueryParams");
/**
* ContentprotectionApi - object-oriented interface
* @export
* @class ContentprotectionApi
* @extends {BaseAPI}
*/
var ContentprotectionApi = /** @class */ (function (_super) {
__extends(ContentprotectionApi, _super);
function ContentprotectionApi(configuration) {
return _super.call(this, configuration) || this;
}
/**
* @summary Add Content Protection to Smooth Streaming
* @param {string} manifestId Id of the Smooth Streaming manifest.
* @param {SmoothManifestContentProtection} smoothManifestContentProtection The Content Protection to be added
* @throws {BitmovinError}
* @memberof ContentprotectionApi
*/
ContentprotectionApi.prototype.create = function (manifestId, smoothManifestContentProtection) {
var pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/encoding/manifests/smooth/{manifest_id}/contentprotection', pathParamMap, smoothManifestContentProtection).then(function (response) {
return (0, Mapper_1.map)(response, SmoothManifestContentProtection_1.default);
});
};
/**
* @summary Delete Content Protection of Smooth Streaming
* @param {string} manifestId Id of the Smooth Streaming manifest.
* @param {string} protectionId Id of the content protection.
* @throws {BitmovinError}
* @memberof ContentprotectionApi
*/
ContentprotectionApi.prototype.delete = function (manifestId, protectionId) {
var pathParamMap = {
manifest_id: manifestId,
protection_id: protectionId
};
return this.restClient.delete('/encoding/manifests/smooth/{manifest_id}/contentprotection/{protection_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary Content Protection of Smooth Streaming Representation Details
* @param {string} manifestId Id of the Smooth Streaming manifest.
* @param {string} protectionId Id of the content protection.
* @throws {BitmovinError}
* @memberof ContentprotectionApi
*/
ContentprotectionApi.prototype.get = function (manifestId, protectionId) {
var pathParamMap = {
manifest_id: manifestId,
protection_id: protectionId
};
return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/contentprotection/{protection_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, SmoothManifestContentProtection_1.default);
});
};
/**
* @summary List Content Protection of Smooth Streaming
* @param {string} manifestId Id of the Smooth Streaming manifest.
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof ContentprotectionApi
*/
ContentprotectionApi.prototype.list = function (manifestId, queryParameters) {
var pathParamMap = {
manifest_id: manifestId
};
var queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new SmoothManifestContentProtectionListQueryParams_1.SmoothManifestContentProtectionListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/contentprotection', pathParamMap, queryParams).then(function (response) {
return new PaginationResponse_1.default(response, SmoothManifestContentProtection_1.default);
});
};
return ContentprotectionApi;
}(BaseAPI_1.BaseAPI));
exports.default = ContentprotectionApi;