devopness-sdk-js
Version:
Devopness API JS/TS SDK - Painless essential DevOps to everyone
66 lines (65 loc) • 3.23 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.ProjectsNetworkRulesApiService = void 0;
const ApiBaseService_1 = require("../../../services/ApiBaseService");
const ApiResponse_1 = require("../../../common/ApiResponse");
const Exceptions_1 = require("../../../common/Exceptions");
/**
* ProjectsNetworkRulesApiService - Auto-generated
*/
class ProjectsNetworkRulesApiService extends ApiBaseService_1.ApiBaseService {
/**
*
* @summary Add a network rule to the given project
* @param {number} projectId The project numeric Id
* @param {NetworkRuleCreate} networkRuleCreate A JSON object containing backgroud process data
*/
addNetworkRuleToProject(projectId, networkRuleCreate) {
return __awaiter(this, void 0, void 0, function* () {
if (projectId === null || projectId === undefined) {
throw new Exceptions_1.ArgumentNullException('projectId', 'addNetworkRuleToProject');
}
if (networkRuleCreate === null || networkRuleCreate === undefined) {
throw new Exceptions_1.ArgumentNullException('networkRuleCreate', 'addNetworkRuleToProject');
}
const response = yield this.post(`/projects/{project_id}/network-rules`.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))), networkRuleCreate);
return new ApiResponse_1.ApiResponse(response);
});
}
/**
*
* @summary Returns a list of all network rules that applies to a project
* @param {number} projectId Numeric ID of the project to get network rules from
*/
listProjectNetworkRules(projectId) {
return __awaiter(this, void 0, void 0, function* () {
if (projectId === null || projectId === undefined) {
throw new Exceptions_1.ArgumentNullException('projectId', 'listProjectNetworkRules');
}
const response = yield this.get(`/projects/{project_id}/network-rules`.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))));
return new ApiResponse_1.ApiResponse(response);
});
}
}
exports.ProjectsNetworkRulesApiService = ProjectsNetworkRulesApiService;
;