@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
85 lines (84 loc) • 3.33 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 Webhook_1 = require("../../../../../models/Webhook");
const PaginationResponse_1 = require("../../../../../models/PaginationResponse");
/**
* ErrorApi - object-oriented interface
* @export
* @class ErrorApi
* @extends {BaseAPI}
*/
class ErrorApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @summary Add 'Manifest Error' Webhook (All Manifests)
* @param {Webhook} webhook The 'Manifest Error' Webhook to be added.
* @throws {BitmovinError}
* @memberof ErrorApi
*/
create(webhook) {
return this.restClient.post('/notifications/webhooks/encoding/manifest/error', {}, webhook).then((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
*/
createByManifestId(manifestId, webhook) {
const pathParamMap = {
manifest_id: manifestId
};
return this.restClient.post('/notifications/webhooks/encoding/manifest/{manifest_id}/error', pathParamMap, webhook).then((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
*/
delete(notificationId) {
const pathParamMap = {
notification_id: notificationId
};
return this.restClient.delete('/notifications/webhooks/encoding/manifest/error/{notification_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary Get 'Manifest Error' Webhooks (All Manifests)
* @throws {BitmovinError}
* @memberof ErrorApi
*/
list() {
return this.restClient.get('/notifications/webhooks/encoding/manifest/error', {}).then((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
*/
update(notificationId, webhook) {
const pathParamMap = {
notification_id: notificationId
};
return this.restClient.put('/notifications/webhooks/encoding/manifest/error/{notification_id}', pathParamMap, webhook).then((response) => {
return (0, Mapper_1.map)(response, Webhook_1.default);
});
}
}
exports.default = ErrorApi;