@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
102 lines (101 loc) • 4.38 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 Webhook_1 = require("../../../../../models/Webhook");
var PaginationResponse_1 = require("../../../../../models/PaginationResponse");
/**
* ErrorApi - object-oriented interface
* @export
* @class ErrorApi
* @extends {BaseAPI}
*/
var ErrorApi = /** @class */ (function (_super) {
__extends(ErrorApi, _super);
function ErrorApi(configuration) {
return _super.call(this, configuration) || this;
}
/**
* @summary Add 'Manifest Error' Webhook (All Manifests)
* @param {Webhook} webhook The 'Manifest Error' Webhook to be added.
* @throws {BitmovinError}
* @memberof ErrorApi
*/
ErrorApi.prototype.create = function (webhook) {
return this.restClient.post('/notifications/webhooks/encoding/manifest/error', {}, webhook).then(function (response) {
return (0, Mapper_1.map)(response, Webhook_1.default);
});
};
/**
* @summary Add 'Manifest Error' Webhook Notification (Specific Manifest)
* @param {string} manifestId Id of the manifest resource
* @param {Webhook} webhook The webhook notifications object. A maximum number of 5 webhooks per Manifest is allowed
* @throws {BitmovinError}
* @memberof ErrorApi
*/
ErrorApi.prototype.createByManifestId = function (manifestId, webhook) {
var pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/notifications/webhooks/encoding/manifest/{manifest_id}/error', pathParamMap, webhook).then(function (response) {
return (0, Mapper_1.map)(response, Webhook_1.default);
});
};
/**
* @summary Delete 'Manifest Error' Webhook
* @param {string} notificationId Id of the webhook notification
* @throws {BitmovinError}
* @memberof ErrorApi
*/
ErrorApi.prototype.delete = function (notificationId) {
var pathParamMap = {
notification_id: notificationId
};
return this.restClient.delete('/notifications/webhooks/encoding/manifest/error/{notification_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary Get 'Manifest Error' Webhooks (All Manifests)
* @throws {BitmovinError}
* @memberof ErrorApi
*/
ErrorApi.prototype.list = function () {
return this.restClient.get('/notifications/webhooks/encoding/manifest/error', {}).then(function (response) {
return new PaginationResponse_1.default(response, Webhook_1.default);
});
};
/**
* @summary Replace 'Manifest Error' Webhook Notification
* @param {string} notificationId Id of the webhook notification
* @param {Webhook} webhook The webhook notification with the updated values
* @throws {BitmovinError}
* @memberof ErrorApi
*/
ErrorApi.prototype.update = function (notificationId, webhook) {
var pathParamMap = {
notification_id: notificationId
};
return this.restClient.put('/notifications/webhooks/encoding/manifest/error/{notification_id}', pathParamMap, webhook).then(function (response) {
return (0, Mapper_1.map)(response, Webhook_1.default);
});
};
return ErrorApi;
}(BaseAPI_1.BaseAPI));
exports.default = ErrorApi;