@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
78 lines (77 loc) • 2.98 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 RedundantRtmpInput_1 = require("../../../models/RedundantRtmpInput");
const PaginationResponse_1 = require("../../../models/PaginationResponse");
const RedundantRtmpInputListQueryParams_1 = require("./RedundantRtmpInputListQueryParams");
/**
* RedundantRtmpApi - object-oriented interface
* @export
* @class RedundantRtmpApi
* @extends {BaseAPI}
*/
class RedundantRtmpApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @summary Create Redundant RTMP Input
* @param {RedundantRtmpInput} redundantRtmpInput The Redundant RTMP input to be created
* @throws {BitmovinError}
* @memberof RedundantRtmpApi
*/
create(redundantRtmpInput) {
return this.restClient.post('/encoding/inputs/redundant-rtmp', {}, redundantRtmpInput).then((response) => {
return (0, Mapper_1.map)(response, RedundantRtmpInput_1.default);
});
}
/**
* @summary Delete Redundant RTMP Input
* @param {string} inputId Id of the input
* @throws {BitmovinError}
* @memberof RedundantRtmpApi
*/
delete(inputId) {
const pathParamMap = {
input_id: inputId
};
return this.restClient.delete('/encoding/inputs/redundant-rtmp/{input_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary Redundant RTMP Input Details
* @param {string} inputId Id of the input
* @throws {BitmovinError}
* @memberof RedundantRtmpApi
*/
get(inputId) {
const pathParamMap = {
input_id: inputId
};
return this.restClient.get('/encoding/inputs/redundant-rtmp/{input_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, RedundantRtmpInput_1.default);
});
}
/**
* @summary List Redundant RTMP Inputs
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof RedundantRtmpApi
*/
list(queryParameters) {
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new RedundantRtmpInputListQueryParams_1.RedundantRtmpInputListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/inputs/redundant-rtmp', {}, queryParams).then((response) => {
return new PaginationResponse_1.default(response, RedundantRtmpInput_1.default);
});
}
}
exports.default = RedundantRtmpApi;