UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

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