UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

106 lines (105 loc) 5.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const BaseAPI_1 = require("../../../../../../common/BaseAPI"); const Mapper_1 = require("../../../../../../common/Mapper"); const BitmovinResponse_1 = require("../../../../../../models/BitmovinResponse"); const ContentProtection_1 = require("../../../../../../models/ContentProtection"); const PaginationResponse_1 = require("../../../../../../models/PaginationResponse"); const ContentProtectionListQueryParams_1 = require("./ContentProtectionListQueryParams"); /** * ContentprotectionApi - object-oriented interface * @export * @class ContentprotectionApi * @extends {BaseAPI} */ class ContentprotectionApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); } /** * @summary Add Content Protection to AdaptationSet * @param {string} manifestId Id of the manifest * @param {string} periodId Id of the period * @param {string} adaptationsetId Id of the adaptation set * @param {ContentProtection} contentProtection The content protection to be added to the adaptation set * @throws {BitmovinError} * @memberof ContentprotectionApi */ create(manifestId, periodId, adaptationsetId, contentProtection) { const pathParamMap = { manifest_id: manifestId, period_id: periodId, adaptationset_id: adaptationsetId }; return this.restClient.post('/encoding/manifests/dash/{manifest_id}/periods/{period_id}/adaptationsets/{adaptationset_id}/contentprotection', pathParamMap, contentProtection).then((response) => { return (0, Mapper_1.map)(response, ContentProtection_1.default); }); } /** * @summary Delete AdaptationSet Content Protection * @param {string} manifestId Id of the manifest * @param {string} periodId Id of the period * @param {string} adaptationsetId Id of the adaptation set * @param {string} contentprotectionId Id of the adaptation set content protection to be deleted * @throws {BitmovinError} * @memberof ContentprotectionApi */ delete(manifestId, periodId, adaptationsetId, contentprotectionId) { const pathParamMap = { manifest_id: manifestId, period_id: periodId, adaptationset_id: adaptationsetId, contentprotection_id: contentprotectionId }; return this.restClient.delete('/encoding/manifests/dash/{manifest_id}/periods/{period_id}/adaptationsets/{adaptationset_id}/contentprotection/{contentprotection_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); } /** * @summary AdaptationSet Content Protection Details * @param {string} manifestId Id of the manifest * @param {string} periodId Id of the period * @param {string} adaptationsetId Id of the adaptation set * @param {string} contentprotectionId Id of the adaptation set content protection * @throws {BitmovinError} * @memberof ContentprotectionApi */ get(manifestId, periodId, adaptationsetId, contentprotectionId) { const pathParamMap = { manifest_id: manifestId, period_id: periodId, adaptationset_id: adaptationsetId, contentprotection_id: contentprotectionId }; return this.restClient.get('/encoding/manifests/dash/{manifest_id}/periods/{period_id}/adaptationsets/{adaptationset_id}/contentprotection/{contentprotection_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, ContentProtection_1.default); }); } /** * @summary List all AdaptationSet Content Protections * @param {string} manifestId Id of the manifest * @param {string} periodId Id of the period * @param {string} adaptationsetId Id of the adaptation set * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof ContentprotectionApi */ list(manifestId, periodId, adaptationsetId, queryParameters) { const pathParamMap = { manifest_id: manifestId, period_id: periodId, adaptationset_id: adaptationsetId }; let queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new ContentProtectionListQueryParams_1.ContentProtectionListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/manifests/dash/{manifest_id}/periods/{period_id}/adaptationsets/{adaptationset_id}/contentprotection', pathParamMap, queryParams).then((response) => { return new PaginationResponse_1.default(response, ContentProtection_1.default); }); } } exports.default = ContentprotectionApi;