UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

79 lines (78 loc) 2.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const BaseAPI_1 = require("../../../common/BaseAPI"); const Mapper_1 = require("../../../common/Mapper"); const RegionsApi_1 = require("./regions/RegionsApi"); const OciAccount_1 = require("../../../models/OciAccount"); const PaginationResponse_1 = require("../../../models/PaginationResponse"); const OciAccountListQueryParams_1 = require("./OciAccountListQueryParams"); /** * OciApi - object-oriented interface * @export * @class OciApi * @extends {BaseAPI} */ class OciApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); this.regions = new RegionsApi_1.default(configuration); } /** * @summary Add OCI account * @param {OciAccount} ociAccount The OCI account to be added * @throws {BitmovinError} * @memberof OciApi */ create(ociAccount) { return this.restClient.post('/encoding/infrastructure/oci', {}, ociAccount).then((response) => { return (0, Mapper_1.map)(response, OciAccount_1.default); }); } /** * @summary Delete OCI account * @param {string} infrastructureId Id of the OCI account * @throws {BitmovinError} * @memberof OciApi */ delete(infrastructureId) { const pathParamMap = { infrastructure_id: infrastructureId }; return this.restClient.delete('/encoding/infrastructure/oci/{infrastructure_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, OciAccount_1.default); }); } /** * @summary OCI account details * @param {string} infrastructureId Id of the OCI account * @throws {BitmovinError} * @memberof OciApi */ get(infrastructureId) { const pathParamMap = { infrastructure_id: infrastructureId }; return this.restClient.get('/encoding/infrastructure/oci/{infrastructure_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, OciAccount_1.default); }); } /** * @summary List OCI accounts * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof OciApi */ list(queryParameters) { let queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new OciAccountListQueryParams_1.OciAccountListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/infrastructure/oci', {}, queryParams).then((response) => { return new PaginationResponse_1.default(response, OciAccount_1.default); }); } } exports.default = OciApi;