UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

79 lines (78 loc) 2.72 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 SrtInput_1 = require("../../../models/SrtInput"); const PaginationResponse_1 = require("../../../models/PaginationResponse"); const SrtInputListQueryParams_1 = require("./SrtInputListQueryParams"); /** * SrtApi - object-oriented interface * @export * @class SrtApi * @extends {BaseAPI} */ class SrtApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); this.customdata = new CustomdataApi_1.default(configuration); } /** * @summary Create SRT input * @param {SrtInput} srtInput The SrtInput to be created * @throws {BitmovinError} * @memberof SrtApi */ create(srtInput) { return this.restClient.post('/encoding/inputs/srt', {}, srtInput).then((response) => { return (0, Mapper_1.map)(response, SrtInput_1.default); }); } /** * @summary Delete SRT input * @param {string} inputId Id of the input * @throws {BitmovinError} * @memberof SrtApi */ delete(inputId) { const pathParamMap = { input_id: inputId }; return this.restClient.delete('/encoding/inputs/srt/{input_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, SrtInput_1.default); }); } /** * @summary SRT Input Details * @param {string} inputId Id of the input * @throws {BitmovinError} * @memberof SrtApi */ get(inputId) { const pathParamMap = { input_id: inputId }; return this.restClient.get('/encoding/inputs/srt/{input_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, SrtInput_1.default); }); } /** * @summary List SRT inputs * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof SrtApi */ list(queryParameters) { let queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new SrtInputListQueryParams_1.SrtInputListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/inputs/srt', {}, queryParams).then((response) => { return new PaginationResponse_1.default(response, SrtInput_1.default); }); } } exports.default = SrtApi;