@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
80 lines (79 loc) • 3.27 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 BitmovinResponse_1 = require("../../../../models/BitmovinResponse");
const H264VideoConfiguration_1 = require("../../../../models/H264VideoConfiguration");
const PaginationResponse_1 = require("../../../../models/PaginationResponse");
const H264VideoConfigurationListQueryParams_1 = require("./H264VideoConfigurationListQueryParams");
/**
* H264Api - object-oriented interface
* @export
* @class H264Api
* @extends {BaseAPI}
*/
class H264Api extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
this.customdata = new CustomdataApi_1.default(configuration);
}
/**
* @summary Create H264/AVC Codec Configuration
* @param {H264VideoConfiguration} h264VideoConfiguration The H264/AVC Codec Configuration to be created
* @throws {BitmovinError}
* @memberof H264Api
*/
create(h264VideoConfiguration) {
return this.restClient.post('/encoding/configurations/video/h264', {}, h264VideoConfiguration).then((response) => {
return (0, Mapper_1.map)(response, H264VideoConfiguration_1.default);
});
}
/**
* @summary Delete H264/AVC Codec Configuration
* @param {string} configurationId Id of the codec configuration
* @throws {BitmovinError}
* @memberof H264Api
*/
delete(configurationId) {
const pathParamMap = {
configuration_id: configurationId
};
return this.restClient.delete('/encoding/configurations/video/h264/{configuration_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary H264/AVC Codec Configuration Details
* @param {string} configurationId Id of the codec configuration
* @throws {BitmovinError}
* @memberof H264Api
*/
get(configurationId) {
const pathParamMap = {
configuration_id: configurationId
};
return this.restClient.get('/encoding/configurations/video/h264/{configuration_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, H264VideoConfiguration_1.default);
});
}
/**
* @summary List H264/AVC Codec Configurations
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof H264Api
*/
list(queryParameters) {
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new H264VideoConfigurationListQueryParams_1.H264VideoConfigurationListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/configurations/video/h264', {}, queryParams).then((response) => {
return new PaginationResponse_1.default(response, H264VideoConfiguration_1.default);
});
}
}
exports.default = H264Api;