"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RunnerCardService = void 0;
const request_1 = require("../core/request");
class RunnerCardService {
/**
* Get all
* Lists all card.
* @returns ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerGetAll() {
const result = await request_1.request({
method: 'GET',
path: `/api/cards`,
});
return result.body;
}
/**
* Post
* Create a new card.
You can provide a associated runner by id but you don't have to.
* @param requestBody CreateRunnerCard
* @returns ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerPost(requestBody) {
const result = await request_1.request({
method: 'POST',
path: `/api/cards`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Lists all information about the card whose id got provided.
* @param id
* @returns ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerGetOne(id) {
const result = await request_1.request({
method: 'GET',
path: `/api/cards/${id}`,
});
return result.body;
}
/**
* Put
* Update the card whose id you provided.
Scans created via this card will still be associated with the old runner.
Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateRunnerCard
* @returns ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerPut(id, requestBody) {
const result = await request_1.request({
method: 'PUT',
path: `/api/cards/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete the card whose id you provided.
If no card with this id exists it will just return 204(no content).
If the card still has scans associated you have to provide the force=true query param (warning: this deletes all scans associated with by this card - please disable it instead or just remove the runner association).
* @param id
* @param force
* @returns ResponseRunnerCard
* @returns ResponseEmpty
* @throws ApiError
*/
static async runnerCardControllerRemove(id, force) {
const result = await request_1.request({
method: 'DELETE',
path: `/api/cards/${id}`,
query: {
'force': force,
},
});
return result.body;
}
}
exports.RunnerCardService = RunnerCardService;