lfk-client-js/dist/services/ScanStationService.js
Nicolai Ort f4905b8df6
All checks were successful
continuous-integration/drone Build is passing
🚀New lib version v1.0.0 [CI SKIP]
2023-04-18 18:05:41 +00:00

91 lines
3.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScanStationService = void 0;
const request_1 = require("../core/request");
class ScanStationService {
/**
* Get all
* Lists all stations. <br> This includes their associated tracks.
* @param page
* @param pageSize
* @result ResponseScanStation
* @throws ApiError
*/
static async scanStationControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/stations`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}
/**
* Post
* Create a new station. <br> Please remeber to provide the station's track's id. <br> Please also remember that the station key is only visibe on creation.
* @param requestBody CreateScanStation
* @result ResponseScanStation
* @throws ApiError
*/
static async scanStationControllerPost(requestBody) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/stations`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Lists all information about the station whose id got provided. <br> This includes it's associated track.
* @param id
* @result ResponseScanStation
* @throws ApiError
*/
static async scanStationControllerGetOne(id) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/stations/${id}`,
});
return result.body;
}
/**
* Put
* Update the station whose id you provided. <br> Please remember that only the description and enabled state can be changed.
* @param id
* @param requestBody UpdateScanStation
* @result ResponseScanStation
* @throws ApiError
*/
static async scanStationControllerPut(id, requestBody) {
const result = await (0, request_1.request)({
method: 'PUT',
path: `/api/stations/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete the station whose id you provided. <br> If no station with this id exists it will just return 204(no content). <br> If the station still has scans associated you have to provide the force=true query param (warning: this deletes all scans associated with/created by this station - please disable it instead).
* @param id
* @param force
* @result ResponseScanStation
* @result ResponseEmpty
* @throws ApiError
*/
static async scanStationControllerRemove(id, force) {
const result = await (0, request_1.request)({
method: 'DELETE',
path: `/api/stations/${id}`,
query: {
'force': force,
},
});
return result.body;
}
}
exports.ScanStationService = ScanStationService;