Newer
Older
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { RoleEnum } from '../models/RoleEnum';
import type { UserIn } from '../models/UserIn';
import type { UserOut } from '../models/UserOut';
import type { UserOutExtended } from '../models/UserOutExtended';
import type { UserRoles } from '../models/UserRoles';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class UserService {
/**
* Create User
* Create a new user in the system and notify him.
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
*
* Permission `user:create` required.
* @param requestBody
* @returns UserOutExtended Successful Response
* @throws ApiError
*/
public static userCreateUser(
requestBody: UserIn,
): CancelablePromise<UserOutExtended> {
return __request(OpenAPI, {
method: 'POST',
url: '/users',
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Error decoding JWT Token`,
401: `Not Authenticated`,
403: `Not Authorized`,
404: `Entity not Found`,
422: `Validation Error`,
},
});
}
/**
* List users and search by their name
* List all users in the system..
*
* Permission `user:list` required.
* @param nameSubstring Filter users by a substring in their name.
* @param filterRoles Filter users by their role. If multiple are selected, they are concatenating by an OR Expression.
* @returns UserOutExtended Successful Response
* @throws ApiError
*/
public static userListUsers(
nameSubstring?: string,
filterRoles?: Array<RoleEnum>,
): CancelablePromise<Array<UserOutExtended>> {
return __request(OpenAPI, {
method: 'GET',
url: '/users',
query: {
'name_substring': nameSubstring,
'filter_roles': filterRoles,
},
errors: {
400: `Error decoding JWT Token`,
401: `Not Authenticated`,
403: `Not Authorized`,
404: `Entity not Found`,
422: `Validation Error`,
},
});
}
/**
* Search Users
* Search for users in the system by their name.
*
* Permission `user: search` required.
* @param nameSubstring Filter users by a substring in their name.
* @returns UserOut Successful Response
* @throws ApiError
*/
public static userSearchUsers(
nameSubstring: string,
): CancelablePromise<Array<UserOut>> {
return __request(OpenAPI, {
method: 'GET',
url: '/users/search',
query: {
'name_substring': nameSubstring,
},
errors: {
400: `Error decoding JWT Token`,
401: `Not Authenticated`,
403: `Not Authorized`,
404: `Entity not Found`,
422: `Validation Error`,
},
});
}
/**
* Get the logged in user
* Return the user associated with the used JWT.
*
* Permission `user:read` required.
* @returns UserOutExtended Successful Response
* @throws ApiError
*/
public static userGetLoggedInUser(): CancelablePromise<UserOutExtended> {
return __request(OpenAPI, {
method: 'GET',
url: '/users/me',
errors: {
400: `Error decoding JWT Token`,
401: `Not Authenticated`,
403: `Not Authorized`,
404: `Entity not Found`,
},
});
}
/**
* Get a user by its uid
* Return the user with the specific uid.
*
* Permission `user:read` required.
* @param uid UID of a user
* @returns UserOut Successful Response
* @throws ApiError
*/
public static userGetUser(
uid: string,
): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'GET',
url: '/users/{uid}',
path: {
'uid': uid,
},
errors: {
400: `Error decoding JWT Token`,
401: `Not Authenticated`,
403: `Not Authorized`,
404: `Entity not Found`,
422: `Validation Error`,
},
});
}
/**
* Update Roles
* Update the roles of a user.
*
* Permission `user:update` required.
* @param uid UID of a user
* @param requestBody
* @returns UserOutExtended Successful Response
* @throws ApiError
*/
public static userUpdateRoles(
uid: string,
requestBody: UserRoles,
): CancelablePromise<UserOutExtended> {
return __request(OpenAPI, {
method: 'PUT',
url: '/users/{uid}/roles',
path: {
'uid': uid,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Error decoding JWT Token`,
401: `Not Authenticated`,
403: `Not Authorized`,
404: `Entity not Found`,
422: `Validation Error`,
},
});
}
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/**
* Resend Invitation
* Resend the invitation link for an user that has an open invitation.
*
* Permission `user:create` required.
* @param uid UID of a user
* @returns UserOutExtended Successful Response
* @throws ApiError
*/
public static userResendInvitation(
uid: string,
): CancelablePromise<UserOutExtended> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/users/{uid}/invitation',
path: {
'uid': uid,
},
errors: {
400: `Error decoding JWT Token`,
401: `Not Authenticated`,
403: `Not Authorized`,
404: `Entity not Found`,
422: `Validation Error`,
},
});
}