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"); /** * LiveManifestReadyApi - object-oriented interface * @export * @class LiveManifestReadyApi * @extends {BaseAPI} */ class LiveManifestReadyApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); this.customdata = new CustomdataApi_1.default(configuration); } /** * @summary Add 'Live Manifest Ready' Webhook * @param {Webhook} webhook The 'Live Manifest Ready' Webhook to be added. * @throws {BitmovinError} * @memberof LiveManifestReadyApi */ create(webhook) { return this.restClient.post('/notifications/webhooks/encoding/encodings/live-manifest-ready', {}, webhook).then((response) => { return (0, Mapper_1.map)(response, Webhook_1.default); }); } /** * @summary Add 'Live Manifest Ready' Webhook for a specific Encoding * @param {string} encodingId Id of the encoding * @param {Webhook} webhook The 'Live Manifest Ready' Webhook to be added. * @throws {BitmovinError} * @memberof LiveManifestReadyApi */ createByEncodingId(encodingId, webhook) { const pathParamMap = { encoding_id: encodingId }; return this.restClient.post('/notifications/webhooks/encoding/encodings/{encoding_id}/live-manifest-ready', pathParamMap, webhook).then((response) => { return (0, Mapper_1.map)(response, Webhook_1.default); }); } /** * @summary Delete 'Live Manifest Ready' Webhook for a specific Encoding * @param {string} encodingId Id of the encoding * @param {string} webhookId Id of the webhook * @throws {BitmovinError} * @memberof LiveManifestReadyApi */ deleteByEncodingIdAndWebhookId(encodingId, webhookId) { const pathParamMap = { encoding_id: encodingId, webhook_id: webhookId }; return this.restClient.delete('/notifications/webhooks/encoding/encodings/{encoding_id}/live-manifest-ready/{webhook_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); } /** * @summary Delete 'Live Manifest Ready' Webhook * @param {string} webhookId Id of the webhook * @throws {BitmovinError} * @memberof LiveManifestReadyApi */ deleteByWebhookId(webhookId) { const pathParamMap = { webhook_id: webhookId }; return this.restClient.delete('/notifications/webhooks/encoding/encodings/live-manifest-ready/{webhook_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); } /** * @summary 'Live Manifest Ready' Webhook Details for a specific Encoding * @param {string} encodingId Id of the encoding * @param {string} webhookId Id of the webhook * @throws {BitmovinError} * @memberof LiveManifestReadyApi */ getByEncodingIdAndWebhookId(encodingId, webhookId) { const pathParamMap = { encoding_id: encodingId, webhook_id: webhookId }; return this.restClient.get('/notifications/webhooks/encoding/encodings/{encoding_id}/live-manifest-ready/{webhook_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, Webhook_1.default); }); } /** * @summary 'Live Manifest Ready' Webhook Details * @param {string} webhookId Id of the webhook * @throws {BitmovinError} * @memberof LiveManifestReadyApi */ getByWebhookId(webhookId) { const pathParamMap = { webhook_id: webhookId }; return this.restClient.get('/notifications/webhooks/encoding/encodings/live-manifest-ready/{webhook_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, Webhook_1.default); }); } /** * @summary List 'Live Manifest Ready' Webhooks * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof LiveManifestReadyApi */ 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/live-manifest-ready', {}, queryParams).then((response) => { return new PaginationResponse_1.default(response, Webhook_1.default); }); } /** * @summary List 'Live Manifest Ready' Webhooks for a specific Encoding * @param {string} encodingId Id of the encoding * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof LiveManifestReadyApi */ 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}/live-manifest-ready', pathParamMap, queryParams).then((response) => { return new PaginationResponse_1.default(response, Webhook_1.default); }); } } exports.default = LiveManifestReadyApi;