@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
78 lines (77 loc) • 3.63 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 EmailNotification_1 = require("../../../../../models/EmailNotification");
var EncodingErrorEmailNotification_1 = require("../../../../../models/EncodingErrorEmailNotification");
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 Encoding Error Email Notification (All Encodings)
* @param {EncodingErrorEmailNotification} encodingErrorEmailNotification Add a new email notification if an encoding received an error
* @throws {BitmovinError}
* @memberof ErrorApi
*/
ErrorApi.prototype.create = function (encodingErrorEmailNotification) {
return this.restClient.post('/notifications/emails/encoding/encodings/error', {}, encodingErrorEmailNotification).then(function (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
*/
ErrorApi.prototype.createByEncodingId = function (encodingId, emailNotification) {
var pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/notifications/emails/encoding/encodings/{encoding_id}/error', pathParamMap, emailNotification).then(function (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
*/
ErrorApi.prototype.update = function (notificationId, emailNotification) {
var pathParamMap = {
notification_id: notificationId
};
return this.restClient.put('/notifications/emails/encoding/encodings/error/{notification_id}', pathParamMap, emailNotification).then(function (response) {
return (0, Mapper_1.map)(response, EmailNotification_1.default);
});
};
return ErrorApi;
}(BaseAPI_1.BaseAPI));
exports.default = ErrorApi;