@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
79 lines (78 loc) • 2.94 kB
JavaScript
;
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 AzureAccount_1 = require("../../../models/AzureAccount");
const PaginationResponse_1 = require("../../../models/PaginationResponse");
const AzureAccountListQueryParams_1 = require("./AzureAccountListQueryParams");
/**
* AzureApi - object-oriented interface
* @export
* @class AzureApi
* @extends {BaseAPI}
*/
class AzureApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
this.regions = new RegionsApi_1.default(configuration);
}
/**
* @summary Add Azure Account
* @param {AzureAccount} azureAccount The Azure Account to be added
* @throws {BitmovinError}
* @memberof AzureApi
*/
create(azureAccount) {
return this.restClient.post('/encoding/infrastructure/azure', {}, azureAccount).then((response) => {
return (0, Mapper_1.map)(response, AzureAccount_1.default);
});
}
/**
* @summary Delete Azure Account
* @param {string} infrastructureId Id of the Azure account
* @throws {BitmovinError}
* @memberof AzureApi
*/
delete(infrastructureId) {
const pathParamMap = {
infrastructure_id: infrastructureId
};
return this.restClient.delete('/encoding/infrastructure/azure/{infrastructure_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, AzureAccount_1.default);
});
}
/**
* @summary Azure Account Details
* @param {string} infrastructureId Id of the Azure account
* @throws {BitmovinError}
* @memberof AzureApi
*/
get(infrastructureId) {
const pathParamMap = {
infrastructure_id: infrastructureId
};
return this.restClient.get('/encoding/infrastructure/azure/{infrastructure_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, AzureAccount_1.default);
});
}
/**
* @summary List Azure Accounts
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof AzureApi
*/
list(queryParameters) {
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new AzureAccountListQueryParams_1.AzureAccountListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/infrastructure/azure', {}, queryParams).then((response) => {
return new PaginationResponse_1.default(response, AzureAccount_1.default);
});
}
}
exports.default = AzureApi;