@devopness/sdk-js
Version:
Devopness API JS/TS SDK - Painless essential DevOps to everyone
118 lines (117 loc) • 6.09 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.PipelinesStepsApiService = void 0;
const ApiBaseService_1 = require("../../../services/ApiBaseService");
const ApiResponse_1 = require("../../../common/ApiResponse");
const Exceptions_1 = require("../../../common/Exceptions");
/**
* PipelinesStepsApiService - Auto-generated
*/
class PipelinesStepsApiService extends ApiBaseService_1.ApiBaseService {
/**
*
* @summary Add a step to a pipeline
* @param {number} pipelineId The ID of the pipeline.
* @param {StepPipelineCreate} stepPipelineCreate A JSON object containing the resource data
*/
addPipelineStep(pipelineId, stepPipelineCreate) {
return __awaiter(this, void 0, void 0, function* () {
if (pipelineId === null || pipelineId === undefined) {
throw new Exceptions_1.ArgumentNullException('pipelineId', 'addPipelineStep');
}
if (stepPipelineCreate === null || stepPipelineCreate === undefined) {
throw new Exceptions_1.ArgumentNullException('stepPipelineCreate', 'addPipelineStep');
}
let queryString = '';
const requestUrl = '/pipelines/{pipeline_id}/steps' + (queryString ? `?${queryString}` : '');
const response = yield this.post(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))), stepPipelineCreate);
return new ApiResponse_1.ApiResponse(response);
});
}
/**
*
* @summary Link a step to a Pipeline
* @param {number} pipelineId The ID of the pipeline.
* @param {number} stepId The ID of the step.
*/
linkStepToPipeline(pipelineId, stepId) {
return __awaiter(this, void 0, void 0, function* () {
if (pipelineId === null || pipelineId === undefined) {
throw new Exceptions_1.ArgumentNullException('pipelineId', 'linkStepToPipeline');
}
if (stepId === null || stepId === undefined) {
throw new Exceptions_1.ArgumentNullException('stepId', 'linkStepToPipeline');
}
let queryString = '';
const requestUrl = '/pipelines/{pipeline_id}/steps/{step_id}/link' + (queryString ? `?${queryString}` : '');
const response = yield this.post(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))).replace(`{${"step_id"}}`, encodeURIComponent(String(stepId))));
return new ApiResponse_1.ApiResponse(response);
});
}
/**
*
* @summary Unlink a step from a Pipeline
* @param {number} pipelineId The ID of the pipeline.
* @param {number} stepId The ID of the step.
*/
unlinkStepFromPipeline(pipelineId, stepId) {
return __awaiter(this, void 0, void 0, function* () {
if (pipelineId === null || pipelineId === undefined) {
throw new Exceptions_1.ArgumentNullException('pipelineId', 'unlinkStepFromPipeline');
}
if (stepId === null || stepId === undefined) {
throw new Exceptions_1.ArgumentNullException('stepId', 'unlinkStepFromPipeline');
}
let queryString = '';
const requestUrl = '/pipelines/{pipeline_id}/steps/{step_id}/unlink' + (queryString ? `?${queryString}` : '');
const response = yield this.delete(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))).replace(`{${"step_id"}}`, encodeURIComponent(String(stepId))));
return new ApiResponse_1.ApiResponse(response);
});
}
/**
*
* @summary Update an existing Pipeline Step
* @param {number} pipelineId The ID of the pipeline.
* @param {number} stepId The ID of the step.
* @param {StepPipelineUpdate} stepPipelineUpdate A JSON object containing the resource data
*/
updatePipelineStep(pipelineId, stepId, stepPipelineUpdate) {
return __awaiter(this, void 0, void 0, function* () {
if (pipelineId === null || pipelineId === undefined) {
throw new Exceptions_1.ArgumentNullException('pipelineId', 'updatePipelineStep');
}
if (stepId === null || stepId === undefined) {
throw new Exceptions_1.ArgumentNullException('stepId', 'updatePipelineStep');
}
if (stepPipelineUpdate === null || stepPipelineUpdate === undefined) {
throw new Exceptions_1.ArgumentNullException('stepPipelineUpdate', 'updatePipelineStep');
}
let queryString = '';
const requestUrl = '/pipelines/{pipeline_id}/steps/{step_id}' + (queryString ? `?${queryString}` : '');
const response = yield this.put(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))).replace(`{${"step_id"}}`, encodeURIComponent(String(stepId))), stepPipelineUpdate);
return new ApiResponse_1.ApiResponse(response);
});
}
}
exports.PipelinesStepsApiService = PipelinesStepsApiService;
;