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 AwsAccount_1 = require("../../../models/AwsAccount"); const PaginationResponse_1 = require("../../../models/PaginationResponse"); const AwsAccountListQueryParams_1 = require("./AwsAccountListQueryParams"); /** * AwsApi - object-oriented interface * @export * @class AwsApi * @extends {BaseAPI} */ class AwsApi extends BaseAPI_1.BaseAPI { constructor(configuration) { super(configuration); this.regions = new RegionsApi_1.default(configuration); } /** * @summary Add AWS Account * @param {AwsAccount} awsAccount The AWS Account to be added * @throws {BitmovinError} * @memberof AwsApi */ create(awsAccount) { return this.restClient.post('/encoding/infrastructure/aws', {}, awsAccount).then((response) => { return (0, Mapper_1.map)(response, AwsAccount_1.default); }); } /** * @summary Delete AWS Account * @param {string} infrastructureId Id of the AWS account * @throws {BitmovinError} * @memberof AwsApi */ delete(infrastructureId) { const pathParamMap = { infrastructure_id: infrastructureId }; return this.restClient.delete('/encoding/infrastructure/aws/{infrastructure_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, AwsAccount_1.default); }); } /** * @summary AWS Account Details * @param {string} infrastructureId Id of the AWS account * @throws {BitmovinError} * @memberof AwsApi */ get(infrastructureId) { const pathParamMap = { infrastructure_id: infrastructureId }; return this.restClient.get('/encoding/infrastructure/aws/{infrastructure_id}', pathParamMap).then((response) => { return (0, Mapper_1.map)(response, AwsAccount_1.default); }); } /** * @summary List AWS Accounts * @param {*} [queryParameters] query parameters for filtering, sorting and pagination * @throws {BitmovinError} * @memberof AwsApi */ list(queryParameters) { let queryParams = {}; if (typeof queryParameters === 'function') { queryParams = queryParameters(new AwsAccountListQueryParams_1.AwsAccountListQueryParamsBuilder()).buildQueryParams(); } else if (queryParameters) { queryParams = queryParameters; } return this.restClient.get('/encoding/infrastructure/aws', {}, queryParams).then((response) => { return new PaginationResponse_1.default(response, AwsAccount_1.default); }); } } exports.default = AwsApi;