UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

77 lines (76 loc) 2.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const BaseAPI_1 = require("../../../common/BaseAPI"); const Mapper_1 = require("../../../common/Mapper"); const HlsInput_1 = require("../../../models/HlsInput"); const PaginationResponse_1 = require("../../../models/PaginationResponse"); const HlsInputListQueryParams_1 = require("./HlsInputListQueryParams"); /** * HlsApi - object-oriented interface * @export * @class HlsApi * @extends {BaseAPI} */ class HlsApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); } /** * @summary Create HLS input * @param {HlsInput} hlsInput The HLSInput to be created * @throws {BitmovinError} * @memberof HlsApi */ create(hlsInput) { return this.restClient.post('/encoding/inputs/hls', {}, hlsInput).then((response) => { return (0, Mapper_1.map)(response, HlsInput_1.default); }); } /** * @summary Delete HLS Input * @param {string} inputId Id of the input * @throws {BitmovinError} * @memberof HlsApi */ delete(inputId) { const pathParamMap = { input_id: inputId }; return this.restClient.delete('/encoding/inputs/hls/{input_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, HlsInput_1.default); }); } /** * @summary HLS Input Details * @param {string} inputId Id of the input * @throws {BitmovinError} * @memberof HlsApi */ get(inputId) { const pathParamMap = { input_id: inputId }; return this.restClient.get('/encoding/inputs/hls/{input_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, HlsInput_1.default); }); } /** * @summary List HLS inputs * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof HlsApi */ list(queryParameters) { let queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new HlsInputListQueryParams_1.HlsInputListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/inputs/hls', {}, queryParams).then((response) => { return new PaginationResponse_1.default(response, HlsInput_1.default); }); } } exports.default = HlsApi;