@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
61 lines (60 loc) • 2.66 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../../../../common/BaseAPI");
const Mapper_1 = require("../../../../../common/Mapper");
const EmailNotification_1 = require("../../../../../models/EmailNotification");
const EncodingErrorEmailNotification_1 = require("../../../../../models/EncodingErrorEmailNotification");
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 Encoding Error Email Notification (All Encodings)
* @param {EncodingErrorEmailNotification} encodingErrorEmailNotification Add a new email notification if an encoding received an error
* @throws {BitmovinError}
* @memberof ErrorApi
*/
create(encodingErrorEmailNotification) {
return this.restClient.post('/notifications/emails/encoding/encodings/error', {}, encodingErrorEmailNotification).then((response) => {
return new PaginationResponse_1.default(response, EncodingErrorEmailNotification_1.default);
});
}
/**
* @summary Add Encoding Error Email Notification (Specific Encoding)
* @param {string} encodingId Id of the encoding resource
* @param {EmailNotification} emailNotification The email notifications object
* @throws {BitmovinError}
* @memberof ErrorApi
*/
createByEncodingId(encodingId, emailNotification) {
const pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/notifications/emails/encoding/encodings/{encoding_id}/error', pathParamMap, emailNotification).then((response) => {
return (0, Mapper_1.map)(response, EmailNotification_1.default);
});
}
/**
* @summary Replace Encoding Error Email Notification
* @param {string} notificationId Id of the email notification
* @param {EmailNotification} emailNotification The email notification with the updated values
* @throws {BitmovinError}
* @memberof ErrorApi
*/
update(notificationId, emailNotification) {
const pathParamMap = {
notification_id: notificationId
};
return this.restClient.put('/notifications/emails/encoding/encodings/error/{notification_id}', pathParamMap, emailNotification).then((response) => {
return (0, Mapper_1.map)(response, EmailNotification_1.default);
});
}
}
exports.default = ErrorApi;