lfk-client-js/dist/services/RunnerOrganisationService.js
Nicolai Ort 7d6de0936f
All checks were successful
continuous-integration/drone Build is passing
new lib version [CI SKIP]
2021-01-03 18:16:00 +00:00

85 lines
2.8 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RunnerOrganisationService = void 0;
const request_1 = require("../core/request");
class RunnerOrganisationService {
/**
* Get all
* Lists all organisations. <br> This includes their address, contact and teams (if existing/associated).
* @returns ResponseRunnerOrganisation
* @throws ApiError
*/
static async runnerOrganisationControllerGetAll() {
const result = await request_1.request({
method: 'GET',
path: `/api/organisations`,
});
return result.body;
}
/**
* Post
* Create a new organsisation.
* @param requestBody CreateRunnerOrganisation
* @returns ResponseRunnerOrganisation
* @throws ApiError
*/
static async runnerOrganisationControllerPost(requestBody) {
const result = await request_1.request({
method: 'POST',
path: `/api/organisations`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Lists all information about the organisation whose id got provided.
* @param id
* @returns ResponseRunnerOrganisation
* @throws ApiError
*/
static async runnerOrganisationControllerGetOne(id) {
const result = await request_1.request({
method: 'GET',
path: `/api/organisations/${id}`,
});
return result.body;
}
/**
* Put
* Update the organisation whose id you provided. <br> Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateRunnerOrganisation
* @returns ResponseRunnerOrganisation
* @throws ApiError
*/
static async runnerOrganisationControllerPut(id, requestBody) {
const result = await request_1.request({
method: 'PUT',
path: `/api/organisations/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete the organsisation whose id you provided. <br> If the organisation still has runners and/or teams associated this will fail. <br> To delete the organisation with all associated runners and teams set the force QueryParam to true (cascading deletion might take a while). <br> If no organisation with this id exists it will just return 204(no content).
* @param id
* @param force
* @returns ResponseRunnerOrganisation
* @returns ResponseEmpty
* @throws ApiError
*/
static async runnerOrganisationControllerRemove(id, force) {
const result = await request_1.request({
method: 'DELETE',
path: `/api/organisations/${id}`,
query: {
'force': force,
},
});
return result.body;
}
}
exports.RunnerOrganisationService = RunnerOrganisationService;