@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
114 lines (113 loc) • 5.55 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 TypeApi_1 = require("./type/TypeApi");
var S3Api_1 = require("./s3/S3Api");
var S3RoleBasedApi_1 = require("./s3RoleBased/S3RoleBasedApi");
var GenericS3Api_1 = require("./genericS3/GenericS3Api");
var LocalApi_1 = require("./local/LocalApi");
var GcsApi_1 = require("./gcs/GcsApi");
var GcsServiceAccountApi_1 = require("./gcsServiceAccount/GcsServiceAccountApi");
var AzureApi_1 = require("./azure/AzureApi");
var FtpApi_1 = require("./ftp/FtpApi");
var SftpApi_1 = require("./sftp/SftpApi");
var AkamaiMslApi_1 = require("./akamaiMsl/AkamaiMslApi");
var AkamaiNetstorageApi_1 = require("./akamaiNetstorage/AkamaiNetstorageApi");
var LiveMediaIngestApi_1 = require("./liveMediaIngest/LiveMediaIngestApi");
var CdnApi_1 = require("./cdn/CdnApi");
var CheckOutputPermissionsResponse_1 = require("../../models/CheckOutputPermissionsResponse");
var Output_1 = require("../../models/Output");
var PaginationResponse_1 = require("../../models/PaginationResponse");
var OutputListQueryParams_1 = require("./OutputListQueryParams");
/**
* OutputsApi - object-oriented interface
* @export
* @class OutputsApi
* @extends {BaseAPI}
*/
var OutputsApi = /** @class */ (function (_super) {
__extends(OutputsApi, _super);
function OutputsApi(configuration) {
var _this = _super.call(this, configuration) || this;
_this.type = new TypeApi_1.default(configuration);
_this.s3 = new S3Api_1.default(configuration);
_this.s3RoleBased = new S3RoleBasedApi_1.default(configuration);
_this.genericS3 = new GenericS3Api_1.default(configuration);
_this.local = new LocalApi_1.default(configuration);
_this.gcs = new GcsApi_1.default(configuration);
_this.gcsServiceAccount = new GcsServiceAccountApi_1.default(configuration);
_this.azure = new AzureApi_1.default(configuration);
_this.ftp = new FtpApi_1.default(configuration);
_this.sftp = new SftpApi_1.default(configuration);
_this.akamaiMsl = new AkamaiMslApi_1.default(configuration);
_this.akamaiNetstorage = new AkamaiNetstorageApi_1.default(configuration);
_this.liveMediaIngest = new LiveMediaIngestApi_1.default(configuration);
_this.cdn = new CdnApi_1.default(configuration);
return _this;
}
/**
* @summary Check output permissions (S3 only)
* @param {string} outputId Id of the output to be checked. Currently limited to S3 outputs. The access credentials that have been provided for this Output still need to be valid, otherwise the request will fail. If they are not valid any more, create a new Output with new credentials (resources are immutable).
* @param {CheckOutputPermissionsRequest} [checkOutputPermissionsRequest] Additional parameters for the permissions check
* @throws {BitmovinError}
* @memberof OutputsApi
*/
OutputsApi.prototype.checkPermissions = function (outputId, checkOutputPermissionsRequest) {
var pathParamMap = {
output_id: outputId
};
return this.restClient.post('/encoding/outputs/{output_id}/check-permissions', pathParamMap, checkOutputPermissionsRequest).then(function (response) {
return (0, Mapper_1.map)(response, CheckOutputPermissionsResponse_1.default);
});
};
/**
* @summary Get Output Details
* @param {string} outputId Id of the wanted output
* @throws {BitmovinError}
* @memberof OutputsApi
*/
OutputsApi.prototype.get = function (outputId) {
var pathParamMap = {
output_id: outputId
};
return this.restClient.get('/encoding/outputs/{output_id}', pathParamMap).then(function (response) {
return (0, Mapper_1.map)(response, Output_1.default);
});
};
/**
* @summary List all Outputs
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof OutputsApi
*/
OutputsApi.prototype.list = function (queryParameters) {
var queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new OutputListQueryParams_1.OutputListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/outputs', {}, queryParams).then(function (response) {
return new PaginationResponse_1.default(response, Output_1.default);
});
};
return OutputsApi;
}(BaseAPI_1.BaseAPI));
exports.default = OutputsApi;