@devopness/sdk-js
Version:
Devopness API JS/TS SDK - Painless essential DevOps to everyone
102 lines (101 loc) • 4.92 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.EnvironmentsApiService = void 0;
const ApiBaseService_1 = require("../../../services/ApiBaseService");
const ApiResponse_1 = require("../../../common/ApiResponse");
const Exceptions_1 = require("../../../common/Exceptions");
/**
* EnvironmentsApiService - Auto-generated
*/
class EnvironmentsApiService extends ApiBaseService_1.ApiBaseService {
/**
*
* @summary Archive an environment
* @param {number} environmentId The ID of the environment.
*/
archiveEnvironment(environmentId) {
return __awaiter(this, void 0, void 0, function* () {
if (environmentId === null || environmentId === undefined) {
throw new Exceptions_1.ArgumentNullException('environmentId', 'archiveEnvironment');
}
let queryString = '';
const requestUrl = '/environments/{environment_id}/archive' + (queryString ? `?${queryString}` : '');
const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))));
return new ApiResponse_1.ApiResponse(response);
});
}
/**
*
* @summary Get an environment by ID
* @param {number} environmentId The ID of the environment.
*/
getEnvironment(environmentId) {
return __awaiter(this, void 0, void 0, function* () {
if (environmentId === null || environmentId === undefined) {
throw new Exceptions_1.ArgumentNullException('environmentId', 'getEnvironment');
}
let queryString = '';
const requestUrl = '/environments/{environment_id}' + (queryString ? `?${queryString}` : '');
const response = yield this.get(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))));
return new ApiResponse_1.ApiResponse(response);
});
}
/**
*
* @summary Unarchive an environment
* @param {number} environmentId The ID of the environment.
*/
unarchiveEnvironment(environmentId) {
return __awaiter(this, void 0, void 0, function* () {
if (environmentId === null || environmentId === undefined) {
throw new Exceptions_1.ArgumentNullException('environmentId', 'unarchiveEnvironment');
}
let queryString = '';
const requestUrl = '/environments/{environment_id}/unarchive' + (queryString ? `?${queryString}` : '');
const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))));
return new ApiResponse_1.ApiResponse(response);
});
}
/**
*
* @summary Update a given environment
* @param {number} environmentId The ID of the environment.
* @param {EnvironmentUpdate} environmentUpdate A JSON object containing the resource data
*/
updateEnvironment(environmentId, environmentUpdate) {
return __awaiter(this, void 0, void 0, function* () {
if (environmentId === null || environmentId === undefined) {
throw new Exceptions_1.ArgumentNullException('environmentId', 'updateEnvironment');
}
if (environmentUpdate === null || environmentUpdate === undefined) {
throw new Exceptions_1.ArgumentNullException('environmentUpdate', 'updateEnvironment');
}
let queryString = '';
const requestUrl = '/environments/{environment_id}' + (queryString ? `?${queryString}` : '');
const response = yield this.put(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))), environmentUpdate);
return new ApiResponse_1.ApiResponse(response);
});
}
}
exports.EnvironmentsApiService = EnvironmentsApiService;
;