@devopness/sdk-js
Version:
Devopness API JS/TS SDK - Painless essential DevOps to everyone
78 lines (77 loc) • 4.07 kB
JavaScript
/* eslint-disable */
/**
* devopness API
* Devopness API - Painless essential DevOps to everyone
*
* The version of the OpenAPI document: latest
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.EnvironmentsTeamsApiService = void 0;
const ApiBaseService_1 = require("../../../services/ApiBaseService");
const ApiResponse_1 = require("../../../common/ApiResponse");
const Exceptions_1 = require("../../../common/Exceptions");
/**
* EnvironmentsTeamsApiService - Auto-generated
*/
class EnvironmentsTeamsApiService extends ApiBaseService_1.ApiBaseService {
/**
*
* @summary Link team to a given environment
* @param {number} environmentId The ID of the environment.
* @param {number} teamId The ID of the team.
* @param {TeamEnvironmentLink} teamEnvironmentLink A JSON object containing the resource data
*/
linkTeamToEnvironment(environmentId, teamId, teamEnvironmentLink) {
return __awaiter(this, void 0, void 0, function* () {
if (environmentId === null || environmentId === undefined) {
throw new Exceptions_1.ArgumentNullException('environmentId', 'linkTeamToEnvironment');
}
if (teamId === null || teamId === undefined) {
throw new Exceptions_1.ArgumentNullException('teamId', 'linkTeamToEnvironment');
}
if (teamEnvironmentLink === null || teamEnvironmentLink === undefined) {
throw new Exceptions_1.ArgumentNullException('teamEnvironmentLink', 'linkTeamToEnvironment');
}
let queryString = '';
const requestUrl = '/environments/{environment_id}/teams/{team_id}/link' + (queryString ? `?${queryString}` : '');
const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))).replace(`{${"team_id"}}`, encodeURIComponent(String(teamId))), teamEnvironmentLink);
return new ApiResponse_1.ApiResponse(response);
});
}
/**
*
* @summary Unlink team from the environment
* @param {number} environmentId The ID of the environment.
* @param {number} teamId The ID of the team.
*/
unlinkTeamFromEnvironment(environmentId, teamId) {
return __awaiter(this, void 0, void 0, function* () {
if (environmentId === null || environmentId === undefined) {
throw new Exceptions_1.ArgumentNullException('environmentId', 'unlinkTeamFromEnvironment');
}
if (teamId === null || teamId === undefined) {
throw new Exceptions_1.ArgumentNullException('teamId', 'unlinkTeamFromEnvironment');
}
let queryString = '';
const requestUrl = '/environments/{environment_id}/teams/{team_id}/unlink' + (queryString ? `?${queryString}` : '');
const response = yield this.delete(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))).replace(`{${"team_id"}}`, encodeURIComponent(String(teamId))));
return new ApiResponse_1.ApiResponse(response);
});
}
}
exports.EnvironmentsTeamsApiService = EnvironmentsTeamsApiService;
;