UNPKG

@bitmovin/api-sdk

Version:

Bitmovin JS/TS API SDK

91 lines (90 loc) 3.82 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const BaseAPI_1 = require("../../../../common/BaseAPI"); const Mapper_1 = require("../../../../common/Mapper"); const AzureAccountRegionSettings_1 = require("../../../../models/AzureAccountRegionSettings"); const PaginationResponse_1 = require("../../../../models/PaginationResponse"); const AzureAccountRegionSettingsListQueryParams_1 = require("./AzureAccountRegionSettingsListQueryParams"); /** * RegionsApi - object-oriented interface * @export * @class RegionsApi * @extends {BaseAPI} */ class RegionsApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); } /** * @summary Add Azure Region Setting * @param {string} infrastructureId Id of the Azure account * @param {AzureCloudRegion} region Azure region. * @param {AzureAccountRegionSettings} azureAccountRegionSettings The Azure Region Settings to be added * @throws {BitmovinError} * @memberof RegionsApi */ create(infrastructureId, region, azureAccountRegionSettings) { const pathParamMap = { infrastructure_id: infrastructureId, region: region }; return this.restClient.post('/encoding/infrastructure/azure/{infrastructure_id}/regions/{region}', pathParamMap, azureAccountRegionSettings).then((response) => { return (0, Mapper_1.map)(response, AzureAccountRegionSettings_1.default); }); } /** * @summary Delete Azure Region Settings * @param {string} infrastructureId Id of the Azure account * @param {AzureCloudRegion} region Azure region. * @throws {BitmovinError} * @memberof RegionsApi */ delete(infrastructureId, region) { const pathParamMap = { infrastructure_id: infrastructureId, region: region }; return this.restClient.delete('/encoding/infrastructure/azure/{infrastructure_id}/regions/{region}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, AzureAccountRegionSettings_1.default); }); } /** * @summary Azure Region Settings Details * @param {string} infrastructureId Id of the Azure account * @param {AzureCloudRegion} region Azure region. * @throws {BitmovinError} * @memberof RegionsApi */ get(infrastructureId, region) { const pathParamMap = { infrastructure_id: infrastructureId, region: region }; return this.restClient.get('/encoding/infrastructure/azure/{infrastructure_id}/regions/{region}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, AzureAccountRegionSettings_1.default); }); } /** * @summary List Azure Region Settings * @param {string} infrastructureId Id of the Azure account * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof RegionsApi */ list(infrastructureId, queryParameters) { const pathParamMap = { infrastructure_id: infrastructureId }; let queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new AzureAccountRegionSettingsListQueryParams_1.AzureAccountRegionSettingsListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/infrastructure/azure/{infrastructure_id}/regions', pathParamMap, queryParams).then((response) => { return new PaginationResponse_1.default(response, AzureAccountRegionSettings_1.default); }); } } exports.default = RegionsApi;