Initial commit for the js version
This commit is contained in:
84
dist/services/RunnerService.js
vendored
Normal file
84
dist/services/RunnerService.js
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RunnerService = void 0;
|
||||
const request_1 = require("../core/request");
|
||||
class RunnerService {
|
||||
/**
|
||||
* Get all
|
||||
* Lists all runners.
|
||||
* @result ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerControllerGetAll() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/runners`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post
|
||||
* Create a new runner object (id will be generated automagicly).
|
||||
* @param requestBody CreateRunner
|
||||
* @result any
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerControllerPost(requestBody) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/runners`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get one
|
||||
* Returns a runner of a specified id (if it exists)
|
||||
* @param id
|
||||
* @result ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerControllerGetOne(id) {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/runners/${id}`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Put
|
||||
* Update a runner object (id can't be changed).
|
||||
* @param id
|
||||
* @param requestBody UpdateRunner
|
||||
* @result ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerControllerPut(id, requestBody) {
|
||||
const result = await request_1.request({
|
||||
method: 'PUT',
|
||||
path: `/api/runners/${id}`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Remove
|
||||
* Delete a specified runner (if it exists).
|
||||
* @param id
|
||||
* @param force
|
||||
* @result ResponseRunner
|
||||
* @result ResponseEmpty
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerControllerRemove(id, force) {
|
||||
const result = await request_1.request({
|
||||
method: 'DELETE',
|
||||
path: `/api/runners/${id}`,
|
||||
query: {
|
||||
'force': force,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
}
|
||||
exports.RunnerService = RunnerService;
|
||||
Reference in New Issue
Block a user