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/UserService.ts

99 lines
2.4 KiB
TypeScript

/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateUser } from '../models/CreateUser';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { User } from '../models/User';
import type { UserGroupNotFoundError } from '../models/UserGroupNotFoundError';
import { request as __request } from '../core/request';
export class UserService {
/**
* Get all
* Lists all users.
* @result User
* @throws ApiError
*/
public static async userControllerGetAll(): Promise<Array<User>> {
const result = await __request({
method: 'GET',
path: `/api/users`,
});
return result.body;
}
/**
* Post
* Create a new user object (id will be generated automagicly).
* @param requestBody CreateUser
* @result any
* @throws ApiError
*/
public static async userControllerPost(
requestBody?: CreateUser,
): Promise<(User | UserGroupNotFoundError)> {
const result = await __request({
method: 'POST',
path: `/api/users`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Returns a user of a specified id (if it exists)
* @param id
* @result User
* @throws ApiError
*/
public static async userControllerGetOne(
id: number,
): Promise<User> {
const result = await __request({
method: 'GET',
path: `/api/users/${id}`,
});
return result.body;
}
/**
* Put
* Update a user object (id can't be changed).
* @param id
* @param requestBody User
* @result User
* @throws ApiError
*/
public static async userControllerPut(
id: number,
requestBody?: User,
): Promise<User> {
const result = await __request({
method: 'PUT',
path: `/api/users/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete a specified runner (if it exists).
* @param id
* @result User
* @result ResponseEmpty
* @throws ApiError
*/
public static async userControllerRemove(
id: number,
): Promise<User | ResponseEmpty> {
const result = await __request({
method: 'DELETE',
path: `/api/users/${id}`,
});
return result.body;
}
}