@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
78 lines (77 loc) • 3.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../../../common/BaseAPI");
const Mapper_1 = require("../../../../common/Mapper");
const BitmovinResponse_1 = require("../../../../models/BitmovinResponse");
const PassthroughAudioConfiguration_1 = require("../../../../models/PassthroughAudioConfiguration");
const PaginationResponse_1 = require("../../../../models/PaginationResponse");
const PassthroughAudioConfigurationListQueryParams_1 = require("./PassthroughAudioConfigurationListQueryParams");
/**
* PassthroughApi - object-oriented interface
* @export
* @class PassthroughApi
* @extends {BaseAPI}
*/
class PassthroughApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @summary Create Audio Passthrough Configuration
* @param {PassthroughAudioConfiguration} passthroughAudioConfiguration The Audio Passthrough Configuration to be created
* @throws {BitmovinError}
* @memberof PassthroughApi
*/
create(passthroughAudioConfiguration) {
return this.restClient.post('/encoding/configurations/audio/passthrough', {}, passthroughAudioConfiguration).then((response) => {
return (0, Mapper_1.map)(response, PassthroughAudioConfiguration_1.default);
});
}
/**
* @summary Delete Audio Passthrough Codec Configuration
* @param {string} configurationId Id of the audio configuration
* @throws {BitmovinError}
* @memberof PassthroughApi
*/
delete(configurationId) {
const pathParamMap = {
configuration_id: configurationId
};
return this.restClient.delete('/encoding/configurations/audio/passthrough/{configuration_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary Audio Passthrough Configuration Details
* @param {string} configurationId Id of the audio configuration
* @throws {BitmovinError}
* @memberof PassthroughApi
*/
get(configurationId) {
const pathParamMap = {
configuration_id: configurationId
};
return this.restClient.get('/encoding/configurations/audio/passthrough/{configuration_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, PassthroughAudioConfiguration_1.default);
});
}
/**
* @summary List Audio Passthrough Configurations
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof PassthroughApi
*/
list(queryParameters) {
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new PassthroughAudioConfigurationListQueryParams_1.PassthroughAudioConfigurationListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/configurations/audio/passthrough', {}, queryParams).then((response) => {
return new PaginationResponse_1.default(response, PassthroughAudioConfiguration_1.default);
});
}
}
exports.default = PassthroughApi;