@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
53 lines (52 loc) • 1.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../common/BaseAPI");
const Mapper_1 = require("../../common/Mapper");
const StreamsPublicSigningKeyResponse_1 = require("../../models/StreamsPublicSigningKeyResponse");
const StreamsSigningKeyResponse_1 = require("../../models/StreamsSigningKeyResponse");
/**
* SigningKeysApi - object-oriented interface
* @export
* @class SigningKeysApi
* @extends {BaseAPI}
*/
class SigningKeysApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @summary Create new signing-key
* @throws {BitmovinError}
* @memberof SigningKeysApi
*/
create() {
return this.restClient.post('/streams/signing-keys', {}).then((response) => {
return (0, Mapper_1.map)(response, StreamsSigningKeyResponse_1.default);
});
}
/**
* @summary Delete signing-key
* @param {string} keyId Id of the signing key.
* @throws {BitmovinError}
* @memberof SigningKeysApi
*/
delete(keyId) {
const pathParamMap = {
key_id: keyId
};
return this.restClient.delete('/streams/signing-keys/{key_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response);
});
}
/**
* @summary Get list of public signing key ids
* @throws {BitmovinError}
* @memberof SigningKeysApi
*/
get() {
return this.restClient.get('/streams/signing-keys', {}).then((response) => {
return (0, Mapper_1.map)(response, StreamsPublicSigningKeyResponse_1.default);
});
}
}
exports.default = SigningKeysApi;