UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

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