lfk-client-js/dist/services/RunnerTeamService.js
Nicolai Ort 9b6d686d93
All checks were successful
continuous-integration/drone Build is passing
🚀New lib version v0.13.1 [CI SKIP]
2023-02-02 15:19:00 +00:00

99 lines
3.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RunnerTeamService = void 0;
const request_1 = require("../core/request");
class RunnerTeamService {
/**
* Get all
* Lists all teams. <br> This includes their parent organization and contact (if existing/associated).
* @result ResponseRunnerTeam
* @throws ApiError
*/
static async runnerTeamControllerGetAll() {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/teams`,
});
return result.body;
}
/**
* Post
* Create a new organsisation. <br> Please remember to provide it's parent group's id.
* @param requestBody CreateRunnerTeam
* @result ResponseRunnerTeam
* @throws ApiError
*/
static async runnerTeamControllerPost(requestBody) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/teams`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Lists all information about the team whose id got provided.
* @param id
* @result ResponseRunnerTeam
* @throws ApiError
*/
static async runnerTeamControllerGetOne(id) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/teams/${id}`,
});
return result.body;
}
/**
* Put
* Update the team whose id you provided. <br> Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateRunnerTeam
* @result ResponseRunnerTeam
* @throws ApiError
*/
static async runnerTeamControllerPut(id, requestBody) {
const result = await (0, request_1.request)({
method: 'PUT',
path: `/api/teams/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete the team whose id you provided. <br> If the team still has runners associated this will fail. <br> To delete the team with all associated runners set the force QueryParam to true (cascading deletion might take a while). <br> This won't delete the associated contact.<br> If no team with this id exists it will just return 204(no content).
* @param id
* @param force
* @result ResponseRunnerTeam
* @result ResponseEmpty
* @throws ApiError
*/
static async runnerTeamControllerRemove(id, force) {
const result = await (0, request_1.request)({
method: 'DELETE',
path: `/api/teams/${id}`,
query: {
'force': force,
},
});
return result.body;
}
/**
* Get runners
* Lists all runners from this team. <br> This includes the runner's group and distance ran.
* @param id
* @result ResponseRunner
* @throws ApiError
*/
static async runnerTeamControllerGetRunners(id) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/teams/${id}/runners`,
});
return result.body;
}
}
exports.RunnerTeamService = RunnerTeamService;