UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

150 lines (149 loc) 6.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const BaseAPI_1 = require("../../../../../common/BaseAPI"); const Mapper_1 = require("../../../../../common/Mapper"); const CustomdataApi_1 = require("./customdata/CustomdataApi"); const BitmovinResponse_1 = require("../../../../../models/BitmovinResponse"); const Webhook_1 = require("../../../../../models/Webhook"); const PaginationResponse_1 = require("../../../../../models/PaginationResponse"); const WebhookListQueryParams_1 = require("./WebhookListQueryParams"); const WebhookListByEncodingIdQueryParams_1 = require("./WebhookListByEncodingIdQueryParams"); /** * TransferErrorApi - object-oriented interface * @export * @class TransferErrorApi * @extends {BaseAPI} */ class TransferErrorApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); this.customdata = new CustomdataApi_1.default(configuration); } /** * @summary Add 'Encoding Transfer Error' Webhook * @param {Webhook} webhook The 'Encoding Transfer Error' Webhook to be added. * @throws {BitmovinError} * @memberof TransferErrorApi */ create(webhook) { return this.restClient.post('/notifications/webhooks/encoding/encodings/transfer-error', {}, webhook).then((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 */ createByEncodingId(encodingId, webhook) { const pathParamMap = { encoding_id: encodingId }; return this.restClient.post('/notifications/webhooks/encoding/encodings/{encoding_id}/transfer-error', pathParamMap, webhook).then((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 */ deleteByEncodingIdAndWebhookId(encodingId, webhookId) { const pathParamMap = { encoding_id: encodingId, webhook_id: webhookId }; return this.restClient.delete('/notifications/webhooks/encoding/encodings/{encoding_id}/transfer-error/{webhook_id}', pathParamMap).then((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 */ deleteByWebhookId(webhookId) { const pathParamMap = { webhook_id: webhookId }; return this.restClient.delete('/notifications/webhooks/encoding/encodings/transfer-error/{webhook_id}', pathParamMap).then((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 */ getByEncodingIdAndWebhookId(encodingId, webhookId) { const pathParamMap = { encoding_id: encodingId, webhook_id: webhookId }; return this.restClient.get('/notifications/webhooks/encoding/encodings/{encoding_id}/transfer-error/{webhook_id}', pathParamMap).then((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 */ getByWebhookId(webhookId) { const pathParamMap = { webhook_id: webhookId }; return this.restClient.get('/notifications/webhooks/encoding/encodings/transfer-error/{webhook_id}', pathParamMap).then((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 */ list(queryParameters) { let 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((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 */ listByEncodingId(encodingId, queryParameters) { const pathParamMap = { encoding_id: encodingId }; let 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((response) => { return new PaginationResponse_1.default(response, Webhook_1.default); }); } } exports.default = TransferErrorApi;