UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

78 lines (77 loc) 3.46 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var BaseAPI_1 = require("../../common/BaseAPI"); var Mapper_1 = require("../../common/Mapper"); var TypeApi_1 = require("./type/TypeApi"); var VideoApi_1 = require("./video/VideoApi"); var AudioApi_1 = require("./audio/AudioApi"); var SubtitlesApi_1 = require("./subtitles/SubtitlesApi"); var CodecConfiguration_1 = require("../../models/CodecConfiguration"); var PaginationResponse_1 = require("../../models/PaginationResponse"); var CodecConfigurationListQueryParams_1 = require("./CodecConfigurationListQueryParams"); /** * ConfigurationsApi - object-oriented interface * @export * @class ConfigurationsApi * @extends {BaseAPI} */ var ConfigurationsApi = /** @class */ (function (_super) { __extends(ConfigurationsApi, _super); function ConfigurationsApi(configuration) { var _this = _super.call(this, configuration) || this; _this.type = new TypeApi_1.default(configuration); _this.video = new VideoApi_1.default(configuration); _this.audio = new AudioApi_1.default(configuration); _this.subtitles = new SubtitlesApi_1.default(configuration); return _this; } /** * @summary Get Codec Configuration Details * @param {string} configurationId Id of the codec configuration * @throws {BitmovinError} * @memberof ConfigurationsApi */ ConfigurationsApi.prototype.get = function (configurationId) { var pathParamMap = { configuration_id: configurationId }; return this.restClient.get('/encoding/configurations/{configuration_id}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, CodecConfiguration_1.default); }); }; /** * @summary List all Codec Configurations * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof ConfigurationsApi */ ConfigurationsApi.prototype.list = function (queryParameters) { var queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new CodecConfigurationListQueryParams_1.CodecConfigurationListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/configurations', {}, queryParams).then(function (response) { return new PaginationResponse_1.default(response, CodecConfiguration_1.default); }); }; return ConfigurationsApi; }(BaseAPI_1.BaseAPI)); exports.default = ConfigurationsApi;