This repository has been archived on 2023-11-06. You can view files and clone it, but cannot push or open issues or pull requests.
lfk-client-node/dist/services/UserGroupService.js

81 lines
2.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserGroupService = void 0;
const request_1 = require("../core/request");
class UserGroupService {
/**
* Get all
* Lists all usergroups.
* @result UserGroup
* @throws ApiError
*/
static async userGroupControllerGetAll() {
const result = await request_1.request({
method: 'GET',
path: `/api/usergroups`,
});
return result.body;
}
/**
* Post
* Create a new usergroup object (id will be generated automagicly).
* @param requestBody CreateUserGroup
* @result any
* @throws ApiError
*/
static async userGroupControllerPost(requestBody) {
const result = await request_1.request({
method: 'POST',
path: `/api/usergroups`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Returns a usergroup of a specified id (if it exists)
* @param id
* @result UserGroup
* @throws ApiError
*/
static async userGroupControllerGetOne(id) {
const result = await request_1.request({
method: 'GET',
path: `/api/usergroups/${id}`,
});
return result.body;
}
/**
* Put
* Update a usergroup object (id can't be changed).
* @param id
* @param requestBody UserGroup
* @result UserGroup
* @throws ApiError
*/
static async userGroupControllerPut(id, requestBody) {
const result = await request_1.request({
method: 'PUT',
path: `/api/usergroups/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete a specified usergroup (if it exists).
* @param id
* @result UserGroup
* @result ResponseEmpty
* @throws ApiError
*/
static async userGroupControllerRemove(id) {
const result = await request_1.request({
method: 'DELETE',
path: `/api/usergroups/${id}`,
});
return result.body;
}
}
exports.UserGroupService = UserGroupService;