"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.
This includes the runner's group and distance ran.
* @returns 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.
Please remeber to provide the runner's group's id.
* @param requestBody CreateRunner
* @returns 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
* Lists all information about the runner whose id got provided.
* @param id
* @returns ResponseRunner
* @throws ApiError
*/
static async runnerControllerGetOne(id) {
const result = await request_1.request({
method: 'GET',
path: `/api/runners/${id}`,
});
return result.body;
}
/**
* Put
* Update the runner whose id you provided.
Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateRunner
* @returns 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 the runner whose id you provided.
This will also delete all scans and cards associated with the runner.
If no runner with this id exists it will just return 204(no content).
* @param id
* @param force
* @returns ResponseRunner
* @returns 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;