UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

70 lines (69 loc) 2.73 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 StreamsPublicSigningKeyResponse_1 = require("../../models/StreamsPublicSigningKeyResponse"); var StreamsSigningKeyResponse_1 = require("../../models/StreamsSigningKeyResponse"); /** * SigningKeysApi - object-oriented interface * @export * @class SigningKeysApi * @extends {BaseAPI} */ var SigningKeysApi = /** @class */ (function (_super) { __extends(SigningKeysApi, _super); function SigningKeysApi(configuration) { return _super.call(this, configuration) || this; } /** * @summary Create new signing-key * @throws {BitmovinError} * @memberof SigningKeysApi */ SigningKeysApi.prototype.create = function () { return this.restClient.post('/streams/signing-keys', {}).then(function (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 */ SigningKeysApi.prototype.delete = function (keyId) { var pathParamMap = { key_id: keyId }; return this.restClient.delete('/streams/signing-keys/{key_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response); }); }; /** * @summary Get list of public signing key ids * @throws {BitmovinError} * @memberof SigningKeysApi */ SigningKeysApi.prototype.get = function () { return this.restClient.get('/streams/signing-keys', {}).then(function (response) { return (0, Mapper_1.map)(response, StreamsPublicSigningKeyResponse_1.default); }); }; return SigningKeysApi; }(BaseAPI_1.BaseAPI)); exports.default = SigningKeysApi;