lfk-client-js/dist/services/RunnerService.js
Nicolai Ort 9b6d686d93
All checks were successful
continuous-integration/drone Build is passing
🚀New lib version v0.13.1 [CI SKIP]
2023-02-02 15:19:00 +00:00

99 lines
2.9 KiB
JavaScript

"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 from all teams/orgs. <br> This includes the runner's group and distance ran.
* @result ResponseRunner
* @throws ApiError
*/
static async runnerControllerGetAll() {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/runners`,
});
return result.body;
}
/**
* Post
* Create a new runner. <br> Please remeber to provide the runner's group's id.
* @param requestBody CreateRunner
* @result any
* @throws ApiError
*/
static async runnerControllerPost(requestBody) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/runners`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Lists all information about the runner whose id got provided.
* @param id
* @result ResponseRunner
* @throws ApiError
*/
static async runnerControllerGetOne(id) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/runners/${id}`,
});
return result.body;
}
/**
* Put
* Update the runner whose id you provided. <br> Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateRunner
* @result ResponseRunner
* @throws ApiError
*/
static async runnerControllerPut(id, requestBody) {
const result = await (0, request_1.request)({
method: 'PUT',
path: `/api/runners/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete the runner whose id you provided. <br> This will also delete all scans and cards associated with the runner. <br> If no runner with this id exists it will just return 204(no content).
* @param id
* @param force
* @result ResponseRunner
* @result ResponseEmpty
* @throws ApiError
*/
static async runnerControllerRemove(id, force) {
const result = await (0, request_1.request)({
method: 'DELETE',
path: `/api/runners/${id}`,
query: {
'force': force,
},
});
return result.body;
}
/**
* Get scans
* Lists all scans of the runner whose id got provided. <br> If you only want the valid scans just add the ?onlyValid=true query param.
* @param id
* @result any
* @throws ApiError
*/
static async runnerControllerGetScans(id) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/runners/${id}/scans`,
});
return result.body;
}
}
exports.RunnerService = RunnerService;