@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
109 lines (108 loc) • 4.63 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 ActionsApi_1 = require("./actions/ActionsApi");
var EncodingsApi_1 = require("./encodings/EncodingsApi");
var LogsApi_1 = require("./logs/LogsApi");
var BitmovinResponse_1 = require("../../../models/BitmovinResponse");
var LiveStandbyPoolDetails_1 = require("../../../models/LiveStandbyPoolDetails");
var LiveStandbyPoolResponse_1 = require("../../../models/LiveStandbyPoolResponse");
var PaginationResponse_1 = require("../../../models/PaginationResponse");
/**
* StandbyPoolsApi - object-oriented interface
* @export
* @class StandbyPoolsApi
* @extends {BaseAPI}
*/
var StandbyPoolsApi = /** @class */ (function (_super) {
__extends(StandbyPoolsApi, _super);
function StandbyPoolsApi(configuration) {
var _this = _super.call(this, configuration) || this;
_this.actions = new ActionsApi_1.default(configuration);
_this.encodings = new EncodingsApi_1.default(configuration);
_this.logs = new LogsApi_1.default(configuration);
return _this;
}
/**
* @summary Create new standby pool
* @param {LiveStandbyPoolRequest} liveStandbyPoolRequest The pool to be created
* @throws {BitmovinError}
* @memberof StandbyPoolsApi
*/
StandbyPoolsApi.prototype.create = function (liveStandbyPoolRequest) {
return this.restClient.post('/encoding/live/standby-pools', {}, liveStandbyPoolRequest).then(function (response) {
return (0, Mapper_1.map)(response, LiveStandbyPoolDetails_1.default);
});
};
/**
* @summary Delete standby pool by id
* @param {string} poolId Id of the standby pool
* @throws {BitmovinError}
* @memberof StandbyPoolsApi
*/
StandbyPoolsApi.prototype.delete = function (poolId) {
var pathParamMap = {
pool_id: poolId
};
return this.restClient.delete('/encoding/live/standby-pools/{pool_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
};
/**
* @summary Get details of a standby pool by id
* @param {string} poolId Id of the standby pool
* @throws {BitmovinError}
* @memberof StandbyPoolsApi
*/
StandbyPoolsApi.prototype.get = function (poolId) {
var pathParamMap = {
pool_id: poolId
};
return this.restClient.get('/encoding/live/standby-pools/{pool_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, LiveStandbyPoolDetails_1.default);
});
};
/**
* @summary List Standby pools
* @throws {BitmovinError}
* @memberof StandbyPoolsApi
*/
StandbyPoolsApi.prototype.list = function () {
return this.restClient.get('/encoding/live/standby-pools', {}).then(function (response) {
return new PaginationResponse_1.default(response, LiveStandbyPoolResponse_1.default);
});
};
/**
* @summary Partially update standby pool by id
* @param {string} poolId Id of the standby pool
* @param {LiveStandbyPoolUpdate} liveStandbyPoolUpdate The updated standby pool object.
* @throws {BitmovinError}
* @memberof StandbyPoolsApi
*/
StandbyPoolsApi.prototype.patch = function (poolId, liveStandbyPoolUpdate) {
var pathParamMap = {
pool_id: poolId
};
return this.restClient.patch('/encoding/live/standby-pools/{pool_id}', pathParamMap, liveStandbyPoolUpdate).then(function (response) {
return (0, Mapper_1.map)(response, LiveStandbyPoolDetails_1.default);
});
};
return StandbyPoolsApi;
}(BaseAPI_1.BaseAPI));
exports.default = StandbyPoolsApi;