UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

80 lines (79 loc) 2.87 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 BitmovinResponse_1 = require("../../../models/BitmovinResponse"); const S3Input_1 = require("../../../models/S3Input"); const PaginationResponse_1 = require("../../../models/PaginationResponse"); const S3InputListQueryParams_1 = require("./S3InputListQueryParams"); /** * S3Api - object-oriented interface * @export * @class S3Api * @extends {BaseAPI} */ class S3Api extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); this.customdata = new CustomdataApi_1.default(configuration); } /** * @summary Create S3 Input * @param {S3Input} s3Input The S3 input to be created The following permissions are required for S3 input: * s3:GetObject * s3:GetBucketLocation, * @throws {BitmovinError} * @memberof S3Api */ create(s3Input) { return this.restClient.post('/encoding/inputs/s3', {}, s3Input).then((response) => { return (0, Mapper_1.map)(response, S3Input_1.default); }); } /** * @summary Delete S3 Input * @param {string} inputId Id of the input * @throws {BitmovinError} * @memberof S3Api */ delete(inputId) { const pathParamMap = { input_id: inputId }; return this.restClient.delete('/encoding/inputs/s3/{input_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); } /** * @summary S3 Input Details * @param {string} inputId Id of the input * @throws {BitmovinError} * @memberof S3Api */ get(inputId) { const pathParamMap = { input_id: inputId }; return this.restClient.get('/encoding/inputs/s3/{input_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, S3Input_1.default); }); } /** * @summary List S3 Inputs * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof S3Api */ list(queryParameters) { let queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new S3InputListQueryParams_1.S3InputListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/inputs/s3', {}, queryParams).then((response) => { return new PaginationResponse_1.default(response, S3Input_1.default); }); } } exports.default = S3Api;