"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.
* @param page
* @param pageSize
* @param createdVia
* @param selfserviceLinks
* @result ResponseRunner
* @throws ApiError
*/
static async runnerControllerGetAll(page, pageSize, createdVia, selfserviceLinks) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/runners`,
query: {
'page': page,
'page_size': pageSize,
'created_via': createdVia,
'selfservice_links': selfserviceLinks,
},
});
return result.body;
}
/**
* Post
* Create a new runner.
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.
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.
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
* @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.
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;