@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
90 lines (89 loc) • 4.04 kB
JavaScript
;
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 SmoothManifestContentProtection_1 = require("../../../../models/SmoothManifestContentProtection");
const PaginationResponse_1 = require("../../../../models/PaginationResponse");
const SmoothManifestContentProtectionListQueryParams_1 = require("./SmoothManifestContentProtectionListQueryParams");
/**
* ContentprotectionApi - object-oriented interface
* @export
* @class ContentprotectionApi
* @extends {BaseAPI}
*/
class ContentprotectionApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @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
*/
create(manifestId, smoothManifestContentProtection) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/encoding/manifests/smooth/{manifest_id}/contentprotection', pathParamMap, smoothManifestContentProtection).then((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
*/
delete(manifestId, protectionId) {
const pathParamMap = {
manifest_id: manifestId,
protection_id: protectionId
};
return this.restClient.delete('/encoding/manifests/smooth/{manifest_id}/contentprotection/{protection_id}', pathParamMap).then((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
*/
get(manifestId, protectionId) {
const pathParamMap = {
manifest_id: manifestId,
protection_id: protectionId
};
return this.restClient.get('/encoding/manifests/smooth/{manifest_id}/contentprotection/{protection_id}', pathParamMap).then((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
*/
list(manifestId, queryParameters) {
const pathParamMap = {
manifest_id: manifestId
};
let 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((response) => {
return new PaginationResponse_1.default(response, SmoothManifestContentProtection_1.default);
});
}
}
exports.default = ContentprotectionApi;