@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
78 lines (77 loc) • 3.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../../../../common/BaseAPI");
const Mapper_1 = require("../../../../../common/Mapper");
const BitmovinResponse_1 = require("../../../../../models/BitmovinResponse");
const LiveEncodingHeartbeatWebhook_1 = require("../../../../../models/LiveEncodingHeartbeatWebhook");
const PaginationResponse_1 = require("../../../../../models/PaginationResponse");
const LiveEncodingHeartbeatWebhookListQueryParams_1 = require("./LiveEncodingHeartbeatWebhookListQueryParams");
/**
* LiveEncodingHeartbeatApi - object-oriented interface
* @export
* @class LiveEncodingHeartbeatApi
* @extends {BaseAPI}
*/
class LiveEncodingHeartbeatApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @summary Add 'Live Encoding Heartbeat' Webhook
* @param {LiveEncodingHeartbeatWebhook} liveEncodingHeartbeatWebhook The 'Live Encoding Heartbeat' Webhook to be added.
* @throws {BitmovinError}
* @memberof LiveEncodingHeartbeatApi
*/
create(liveEncodingHeartbeatWebhook) {
return this.restClient.post('/notifications/webhooks/encoding/encodings/live-encoding-heartbeat', {}, liveEncodingHeartbeatWebhook).then((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
*/
deleteByWebhookId(webhookId) {
const pathParamMap = {
webhook_id: webhookId
};
return this.restClient.delete('/notifications/webhooks/encoding/encodings/live-encoding-heartbeat/{webhook_id}', pathParamMap).then((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
*/
getByWebhookId(webhookId) {
const pathParamMap = {
webhook_id: webhookId
};
return this.restClient.get('/notifications/webhooks/encoding/encodings/live-encoding-heartbeat/{webhook_id}', pathParamMap).then((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
*/
list(queryParameters) {
let 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((response) => {
return new PaginationResponse_1.default(response, LiveEncodingHeartbeatWebhook_1.default);
});
}
}
exports.default = LiveEncodingHeartbeatApi;