@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
98 lines (97 loc) • 3.91 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 TextFilter_1 = require("../../../models/TextFilter");
var PaginationResponse_1 = require("../../../models/PaginationResponse");
var TextFilterListQueryParams_1 = require("./TextFilterListQueryParams");
/**
* 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 Create Text Filter
* @param {TextFilter} textFilter The Text Filter to be created
* @throws {BitmovinError}
* @memberof TextApi
*/
TextApi.prototype.create = function (textFilter) {
return this.restClient.post('/encoding/filters/text', {}, textFilter).then(function (response) {
return (0, Mapper_1.map)(response, TextFilter_1.default);
});
};
/**
* @summary Delete Text Filter
* @param {string} filterId Id of the Text Filter
* @throws {BitmovinError}
* @memberof TextApi
*/
TextApi.prototype.delete = function (filterId) {
var pathParamMap = {
filter_id: filterId
};
return this.restClient.delete('/encoding/filters/text/{filter_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary Text Filter Details
* @param {string} filterId Id of the Text Filter
* @throws {BitmovinError}
* @memberof TextApi
*/
TextApi.prototype.get = function (filterId) {
var pathParamMap = {
filter_id: filterId
};
return this.restClient.get('/encoding/filters/text/{filter_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, TextFilter_1.default);
});
};
/**
* @summary List Text Filters
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof TextApi
*/
TextApi.prototype.list = function (queryParameters) {
var queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new TextFilterListQueryParams_1.TextFilterListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/filters/text', {}, queryParams).then(function (response) {
return new PaginationResponse_1.default(response, TextFilter_1.default);
});
};
return TextApi;
}(BaseAPI_1.BaseAPI));
exports.default = TextApi;