99 lines
2.6 KiB
TypeScript
99 lines
2.6 KiB
TypeScript
/* istanbul ignore file */
|
|
/* tslint:disable */
|
|
/* eslint-disable */
|
|
import type { CreateUserGroup } from '../models/CreateUserGroup';
|
|
import type { ResponseEmpty } from '../models/ResponseEmpty';
|
|
import type { UserGroup } from '../models/UserGroup';
|
|
import type { UserGroupNotFoundError } from '../models/UserGroupNotFoundError';
|
|
import { request as __request } from '../core/request';
|
|
|
|
export class UserGroupService {
|
|
|
|
/**
|
|
* Get all
|
|
* Lists all usergroups.
|
|
* @result UserGroup
|
|
* @throws ApiError
|
|
*/
|
|
public static async userGroupControllerGetAll(): Promise<Array<UserGroup>> {
|
|
const result = await __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
|
|
*/
|
|
public static async userGroupControllerPost(
|
|
requestBody?: CreateUserGroup,
|
|
): Promise<(UserGroup | UserGroupNotFoundError)> {
|
|
const result = await __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
|
|
*/
|
|
public static async userGroupControllerGetOne(
|
|
id: number,
|
|
): Promise<UserGroup> {
|
|
const result = await __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
|
|
*/
|
|
public static async userGroupControllerPut(
|
|
id: number,
|
|
requestBody?: UserGroup,
|
|
): Promise<UserGroup> {
|
|
const result = await __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
|
|
*/
|
|
public static async userGroupControllerRemove(
|
|
id: number,
|
|
): Promise<UserGroup | ResponseEmpty> {
|
|
const result = await __request({
|
|
method: 'DELETE',
|
|
path: `/api/usergroups/${id}`,
|
|
});
|
|
return result.body;
|
|
}
|
|
|
|
} |