UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

95 lines (94 loc) 4.59 kB
"use strict"; 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 BitmovinResponse_1 = require("../../../../../models/BitmovinResponse"); var LiveEncodingHeartbeatWebhook_1 = require("../../../../../models/LiveEncodingHeartbeatWebhook"); var PaginationResponse_1 = require("../../../../../models/PaginationResponse"); var LiveEncodingHeartbeatWebhookListQueryParams_1 = require("./LiveEncodingHeartbeatWebhookListQueryParams"); /** * LiveEncodingHeartbeatApi - object-oriented interface * @export * @class LiveEncodingHeartbeatApi * @extends {BaseAPI} */ var LiveEncodingHeartbeatApi = /** @class */ (function (_super) { __extends(LiveEncodingHeartbeatApi, _super); function LiveEncodingHeartbeatApi(configuration) { return _super.call(this, configuration) || this; } /** * @summary Add 'Live Encoding Heartbeat' Webhook * @param {LiveEncodingHeartbeatWebhook} liveEncodingHeartbeatWebhook The 'Live Encoding Heartbeat' Webhook to be added. * @throws {BitmovinError} * @memberof LiveEncodingHeartbeatApi */ LiveEncodingHeartbeatApi.prototype.create = function (liveEncodingHeartbeatWebhook) { return this.restClient.post('/notifications/webhooks/encoding/encodings/live-encoding-heartbeat', {}, liveEncodingHeartbeatWebhook).then(function (response) { return (0, Mapper_1.map)(response, LiveEncodingHeartbeatWebhook_1.default); }); }; /** * @summary Delete 'Live Encoding Heartbeat' Webhook * @param {string} webhookId Id of the webhook * @throws {BitmovinError} * @memberof LiveEncodingHeartbeatApi */ LiveEncodingHeartbeatApi.prototype.deleteByWebhookId = function (webhookId) { var pathParamMap = { webhook_id: webhookId }; return this.restClient.delete('/notifications/webhooks/encoding/encodings/live-encoding-heartbeat/{webhook_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); }; /** * @summary 'Live Encoding Heartbeat' Webhook Details * @param {string} webhookId Id of the webhook * @throws {BitmovinError} * @memberof LiveEncodingHeartbeatApi */ LiveEncodingHeartbeatApi.prototype.getByWebhookId = function (webhookId) { var pathParamMap = { webhook_id: webhookId }; return this.restClient.get('/notifications/webhooks/encoding/encodings/live-encoding-heartbeat/{webhook_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, LiveEncodingHeartbeatWebhook_1.default); }); }; /** * @summary List 'Live Encoding Heartbeat' Webhooks * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof LiveEncodingHeartbeatApi */ LiveEncodingHeartbeatApi.prototype.list = function (queryParameters) { var queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new LiveEncodingHeartbeatWebhookListQueryParams_1.LiveEncodingHeartbeatWebhookListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/notifications/webhooks/encoding/encodings/live-encoding-heartbeat', {}, queryParams).then(function (response) { return new PaginationResponse_1.default(response, LiveEncodingHeartbeatWebhook_1.default); }); }; return LiveEncodingHeartbeatApi; }(BaseAPI_1.BaseAPI)); exports.default = LiveEncodingHeartbeatApi;