@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
79 lines (78 loc) • 3.14 kB
JavaScript
;
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 AkamaiNetStorageInput_1 = require("../../../models/AkamaiNetStorageInput");
const PaginationResponse_1 = require("../../../models/PaginationResponse");
const AkamaiNetStorageInputListQueryParams_1 = require("./AkamaiNetStorageInputListQueryParams");
/**
* AkamaiNetstorageApi - object-oriented interface
* @export
* @class AkamaiNetstorageApi
* @extends {BaseAPI}
*/
class AkamaiNetstorageApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
this.customdata = new CustomdataApi_1.default(configuration);
}
/**
* @summary Create Akamai NetStorage Input
* @param {AkamaiNetStorageInput} akamaiNetStorageInput The Akamai NetStorage input to be created
* @throws {BitmovinError}
* @memberof AkamaiNetstorageApi
*/
create(akamaiNetStorageInput) {
return this.restClient.post('/encoding/inputs/akamai-netstorage', {}, akamaiNetStorageInput).then((response) => {
return (0, Mapper_1.map)(response, AkamaiNetStorageInput_1.default);
});
}
/**
* @summary Delete Akamai NetStorage Input
* @param {string} inputId Id of the input
* @throws {BitmovinError}
* @memberof AkamaiNetstorageApi
*/
delete(inputId) {
const pathParamMap = {
input_id: inputId
};
return this.restClient.delete('/encoding/inputs/akamai-netstorage/{input_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, AkamaiNetStorageInput_1.default);
});
}
/**
* @summary Akamai NetStorage Input Details
* @param {string} inputId Id of the input
* @throws {BitmovinError}
* @memberof AkamaiNetstorageApi
*/
get(inputId) {
const pathParamMap = {
input_id: inputId
};
return this.restClient.get('/encoding/inputs/akamai-netstorage/{input_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, AkamaiNetStorageInput_1.default);
});
}
/**
* @summary List Akamai NetStorage Inputs
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof AkamaiNetstorageApi
*/
list(queryParameters) {
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new AkamaiNetStorageInputListQueryParams_1.AkamaiNetStorageInputListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/inputs/akamai-netstorage', {}, queryParams).then((response) => {
return new PaginationResponse_1.default(response, AkamaiNetStorageInput_1.default);
});
}
}
exports.default = AkamaiNetstorageApi;