99 lines
2.4 KiB
TypeScript
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;
|
|
}
|
|
|
|
} |