UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

108 lines (107 loc) 4.82 kB
"use strict"; 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 OciAccountRegionSettings_1 = require("../../../../models/OciAccountRegionSettings"); var PaginationResponse_1 = require("../../../../models/PaginationResponse"); var OciAccountRegionSettingsListQueryParams_1 = require("./OciAccountRegionSettingsListQueryParams"); /** * RegionsApi - object-oriented interface * @export * @class RegionsApi * @extends {BaseAPI} */ var RegionsApi = /** @class */ (function (_super) { __extends(RegionsApi, _super); function RegionsApi(configuration) { return _super.call(this, configuration) || this; } /** * @summary Add OCI account region settings * @param {string} infrastructureId Id of the OCI account * @param {OciCloudRegion} region OCI region * @param {OciAccountRegionSettings} ociAccountRegionSettings The OCI account region settings to be added * @throws {BitmovinError} * @memberof RegionsApi */ RegionsApi.prototype.create = function (infrastructureId, region, ociAccountRegionSettings) { var pathParamMap = { infrastructure_id: infrastructureId, region: region }; return this.restClient.post('/encoding/infrastructure/oci/{infrastructure_id}/regions/{region}', pathParamMap, ociAccountRegionSettings).then(function (response) { return (0, Mapper_1.map)(response, OciAccountRegionSettings_1.default); }); }; /** * @summary Delete OCI account region settings * @param {string} infrastructureId Id of the OCI account * @param {OciCloudRegion} region OCI region * @throws {BitmovinError} * @memberof RegionsApi */ RegionsApi.prototype.delete = function (infrastructureId, region) { var pathParamMap = { infrastructure_id: infrastructureId, region: region }; return this.restClient.delete('/encoding/infrastructure/oci/{infrastructure_id}/regions/{region}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, OciAccountRegionSettings_1.default); }); }; /** * @summary OCI account region settings details * @param {string} infrastructureId Id of the OCI account * @param {OciCloudRegion} region OCI region * @throws {BitmovinError} * @memberof RegionsApi */ RegionsApi.prototype.get = function (infrastructureId, region) { var pathParamMap = { infrastructure_id: infrastructureId, region: region }; return this.restClient.get('/encoding/infrastructure/oci/{infrastructure_id}/regions/{region}', pathParamMap).then(function (response) { return (0, Mapper_1.map)(response, OciAccountRegionSettings_1.default); }); }; /** * @summary List OCI account region settings * @param {string} infrastructureId Id of the OCI account * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof RegionsApi */ RegionsApi.prototype.list = function (infrastructureId, queryParameters) { var pathParamMap = { infrastructure_id: infrastructureId }; var queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new OciAccountRegionSettingsListQueryParams_1.OciAccountRegionSettingsListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/infrastructure/oci/{infrastructure_id}/regions', pathParamMap, queryParams).then(function (response) { return new PaginationResponse_1.default(response, OciAccountRegionSettings_1.default); }); }; return RegionsApi; }(BaseAPI_1.BaseAPI)); exports.default = RegionsApi;