@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
110 lines (109 loc) • 4.53 kB
JavaScript
;
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 CustomdataApi_1 = require("./customdata/CustomdataApi");
var BitmovinResponse_1 = require("../../../../models/BitmovinResponse");
var TextMuxing_1 = require("../../../../models/TextMuxing");
var PaginationResponse_1 = require("../../../../models/PaginationResponse");
var TextMuxingListQueryParams_1 = require("./TextMuxingListQueryParams");
/**
* TextApi - object-oriented interface
* @export
* @class TextApi
* @extends {BaseAPI}
*/
var TextApi = /** @class */ (function (_super) {
__extends(TextApi, _super);
function TextApi(configuration) {
var _this = _super.call(this, configuration) || this;
_this.customdata = new CustomdataApi_1.default(configuration);
return _this;
}
/**
* @summary Add Text muxing
* @param {string} encodingId Id of the encoding.
* @param {TextMuxing} textMuxing The Text muxing to be created
* @throws {BitmovinError}
* @memberof TextApi
*/
TextApi.prototype.create = function (encodingId, textMuxing) {
var pathParamMap = {
encoding_id: encodingId
};
return this.restClient.post('/encoding/encodings/{encoding_id}/muxings/text', pathParamMap, textMuxing).then(function (response) {
return (0, Mapper_1.map)(response, TextMuxing_1.default);
});
};
/**
* @summary Delete Text muxing
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the Text muxing
* @throws {BitmovinError}
* @memberof TextApi
*/
TextApi.prototype.delete = function (encodingId, muxingId) {
var pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId
};
return this.restClient.delete('/encoding/encodings/{encoding_id}/muxings/text/{muxing_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary Text muxing details
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the Text muxing
* @throws {BitmovinError}
* @memberof TextApi
*/
TextApi.prototype.get = function (encodingId, muxingId) {
var pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId
};
return this.restClient.get('/encoding/encodings/{encoding_id}/muxings/text/{muxing_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, TextMuxing_1.default);
});
};
/**
* @summary List Text muxings
* @param {string} encodingId Id of the encoding.
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof TextApi
*/
TextApi.prototype.list = function (encodingId, queryParameters) {
var pathParamMap = {
encoding_id: encodingId
};
var queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new TextMuxingListQueryParams_1.TextMuxingListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/encodings/{encoding_id}/muxings/text', pathParamMap, queryParams).then(function (response) {
return new PaginationResponse_1.default(response, TextMuxing_1.default);
});
};
return TextApi;
}(BaseAPI_1.BaseAPI));
exports.default = TextApi;