@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
168 lines (167 loc) • 7.7 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 CustomdataApi_1 = require("./customdata/CustomdataApi");
var BitmovinResponse_1 = require("../../../../../models/BitmovinResponse");
var Webhook_1 = require("../../../../../models/Webhook");
var PaginationResponse_1 = require("../../../../../models/PaginationResponse");
var WebhookListQueryParams_1 = require("./WebhookListQueryParams");
var WebhookListByEncodingIdQueryParams_1 = require("./WebhookListByEncodingIdQueryParams");
/**
* TransferErrorApi - object-oriented interface
* @export
* @class TransferErrorApi
* @extends {BaseAPI}
*/
var TransferErrorApi = /** @class */ (function (_super) {
__extends(TransferErrorApi, _super);
function TransferErrorApi(configuration) {
var _this = _super.call(this, configuration) || this;
_this.customdata = new CustomdataApi_1.default(configuration);
return _this;
}
/**
* @summary Add 'Encoding Transfer Error' Webhook
* @param {Webhook} webhook The 'Encoding Transfer Error' Webhook to be added.
* @throws {BitmovinError}
* @memberof TransferErrorApi
*/
TransferErrorApi.prototype.create = function (webhook) {
return this.restClient.post('/notifications/webhooks/encoding/encodings/transfer-error', {}, webhook).then(function (response) {
return (0, Mapper_1.map)(response, Webhook_1.default);
});
};
/**
* @summary Add 'Encoding Transfer Error' Webhook for a specific Encoding
* @param {string} encodingId Id of the encoding
* @param {Webhook} webhook The 'Encoding Transfer Error' Webhook to be added. A maximum number of 5 webhooks per Encoding is allowed
* @throws {BitmovinError}
* @memberof TransferErrorApi
*/
TransferErrorApi.prototype.createByEncodingId = function (encodingId, webhook) {
var pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/notifications/webhooks/encoding/encodings/{encoding_id}/transfer-error', pathParamMap, webhook).then(function (response) {
return (0, Mapper_1.map)(response, Webhook_1.default);
});
};
/**
* @summary Delete 'Encoding Transfer Error' Webhook for a specific Encoding
* @param {string} encodingId Id of the encoding
* @param {string} webhookId Id of the webhook
* @throws {BitmovinError}
* @memberof TransferErrorApi
*/
TransferErrorApi.prototype.deleteByEncodingIdAndWebhookId = function (encodingId, webhookId) {
var pathParamMap = {
encoding_id: encodingId,
webhook_id: webhookId
};
return this.restClient.delete('/notifications/webhooks/encoding/encodings/{encoding_id}/transfer-error/{webhook_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary Delete 'Encoding Transfer Error' Webhook
* @param {string} webhookId Id of the webhook
* @throws {BitmovinError}
* @memberof TransferErrorApi
*/
TransferErrorApi.prototype.deleteByWebhookId = function (webhookId) {
var pathParamMap = {
webhook_id: webhookId
};
return this.restClient.delete('/notifications/webhooks/encoding/encodings/transfer-error/{webhook_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary 'Encoding Transfer Error' Webhook Details for a specific Encoding
* @param {string} encodingId Id of the encoding
* @param {string} webhookId Id of the webhook
* @throws {BitmovinError}
* @memberof TransferErrorApi
*/
TransferErrorApi.prototype.getByEncodingIdAndWebhookId = function (encodingId, webhookId) {
var pathParamMap = {
encoding_id: encodingId,
webhook_id: webhookId
};
return this.restClient.get('/notifications/webhooks/encoding/encodings/{encoding_id}/transfer-error/{webhook_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, Webhook_1.default);
});
};
/**
* @summary 'Encoding Transfer Error' Webhook Details
* @param {string} webhookId Id of the webhook
* @throws {BitmovinError}
* @memberof TransferErrorApi
*/
TransferErrorApi.prototype.getByWebhookId = function (webhookId) {
var pathParamMap = {
webhook_id: webhookId
};
return this.restClient.get('/notifications/webhooks/encoding/encodings/transfer-error/{webhook_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, Webhook_1.default);
});
};
/**
* @summary List 'Encoding Transfer Error' Webhooks
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof TransferErrorApi
*/
TransferErrorApi.prototype.list = function (queryParameters) {
var queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new WebhookListQueryParams_1.WebhookListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/notifications/webhooks/encoding/encodings/transfer-error', {}, queryParams).then(function (response) {
return new PaginationResponse_1.default(response, Webhook_1.default);
});
};
/**
* @summary List 'Encoding Transfer Error' Webhooks for a specific Encoding
* @param {string} encodingId Id of the encoding
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof TransferErrorApi
*/
TransferErrorApi.prototype.listByEncodingId = function (encodingId, queryParameters) {
var pathParamMap = {
encoding_id: encodingId
};
var queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new WebhookListByEncodingIdQueryParams_1.WebhookListByEncodingIdQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/notifications/webhooks/encoding/encodings/{encoding_id}/transfer-error', pathParamMap, queryParams).then(function (response) {
return new PaginationResponse_1.default(response, Webhook_1.default);
});
};
return TransferErrorApi;
}(BaseAPI_1.BaseAPI));
exports.default = TransferErrorApi;