UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

80 lines (79 loc) 3.55 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 DtsPassthroughAudioConfiguration_1 = require("../../../../models/DtsPassthroughAudioConfiguration"); const PaginationResponse_1 = require("../../../../models/PaginationResponse"); const DtsPassthroughAudioConfigurationListQueryParams_1 = require("./DtsPassthroughAudioConfigurationListQueryParams"); /** * DtsPassthroughApi - object-oriented interface * @export * @class DtsPassthroughApi * @extends {BaseAPI} */ class DtsPassthroughApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); this.customdata = new CustomdataApi_1.default(configuration); } /** * @summary Create DTS Passthrough Configuration * @param {DtsPassthroughAudioConfiguration} dtsPassthroughAudioConfiguration The DTS Passthrough Codec Configuration to be created * @throws {BitmovinError} * @memberof DtsPassthroughApi */ create(dtsPassthroughAudioConfiguration) { return this.restClient.post('/encoding/configurations/audio/dts-passthrough', {}, dtsPassthroughAudioConfiguration).then((response) => { return (0, Mapper_1.map)(response, DtsPassthroughAudioConfiguration_1.default); }); } /** * @summary Delete DTS Passthrough Codec Configuration * @param {string} configurationId Id of the codec configuration * @throws {BitmovinError} * @memberof DtsPassthroughApi */ delete(configurationId) { const pathParamMap = { configuration_id: configurationId }; return this.restClient.delete('/encoding/configurations/audio/dts-passthrough/{configuration_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, BitmovinResponse_1.default); }); } /** * @summary DTS Passthrough Codec Configuration Details * @param {string} configurationId Id of the codec configuration * @throws {BitmovinError} * @memberof DtsPassthroughApi */ get(configurationId) { const pathParamMap = { configuration_id: configurationId }; return this.restClient.get('/encoding/configurations/audio/dts-passthrough/{configuration_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, DtsPassthroughAudioConfiguration_1.default); }); } /** * @summary List DTS Passthrough Configurations * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof DtsPassthroughApi */ list(queryParameters) { let queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new DtsPassthroughAudioConfigurationListQueryParams_1.DtsPassthroughAudioConfigurationListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/configurations/audio/dts-passthrough', {}, queryParams).then((response) => { return new PaginationResponse_1.default(response, DtsPassthroughAudioConfiguration_1.default); }); } } exports.default = DtsPassthroughApi;