102 lines
3.2 KiB
JavaScript
102 lines
3.2 KiB
JavaScript
"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. <br> 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. <br> Scans created via this card will still be associated with the old runner. <br> 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. <br> If no card with this id exists it will just return 204(no content). <br> 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;
|
|
}
|
|
/**
|
|
* Post blanco bulk
|
|
* Create blank cards in bulk. <br> Just provide the count as a query param and wait for the 200 response.
|
|
* @param count
|
|
* @returns ResponseEmpty
|
|
* @throws ApiError
|
|
*/
|
|
static async runnerCardControllerPostBlancoBulk(count) {
|
|
const result = await request_1.request({
|
|
method: 'POST',
|
|
path: `/api/cards/bulk`,
|
|
query: {
|
|
'count': count,
|
|
},
|
|
});
|
|
return result.body;
|
|
}
|
|
}
|
|
exports.RunnerCardService = RunnerCardService;
|