user_api.dart 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. //
  2. // AUTO-GENERATED FILE, DO NOT MODIFY!
  3. //
  4. // @dart=2.12
  5. // ignore_for_file: unused_element, unused_import
  6. // ignore_for_file: always_put_required_named_parameters_first
  7. // ignore_for_file: constant_identifier_names
  8. // ignore_for_file: lines_longer_than_80_chars
  9. part of openapi.api;
  10. class UserApi {
  11. UserApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'POST /user/profile-image' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [MultipartFile] file (required):
  17. Future<Response> createProfileImageWithHttpInfo(MultipartFile file,) async {
  18. // ignore: prefer_const_declarations
  19. final path = r'/user/profile-image';
  20. // ignore: prefer_final_locals
  21. Object? postBody;
  22. final queryParams = <QueryParam>[];
  23. final headerParams = <String, String>{};
  24. final formParams = <String, String>{};
  25. const contentTypes = <String>['multipart/form-data'];
  26. bool hasFields = false;
  27. final mp = MultipartRequest('POST', Uri.parse(path));
  28. if (file != null) {
  29. hasFields = true;
  30. mp.fields[r'file'] = file.field;
  31. mp.files.add(file);
  32. }
  33. if (hasFields) {
  34. postBody = mp;
  35. }
  36. return apiClient.invokeAPI(
  37. path,
  38. 'POST',
  39. queryParams,
  40. postBody,
  41. headerParams,
  42. formParams,
  43. contentTypes.isEmpty ? null : contentTypes.first,
  44. );
  45. }
  46. /// Parameters:
  47. ///
  48. /// * [MultipartFile] file (required):
  49. Future<CreateProfileImageResponseDto?> createProfileImage(MultipartFile file,) async {
  50. final response = await createProfileImageWithHttpInfo(file,);
  51. if (response.statusCode >= HttpStatus.badRequest) {
  52. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  53. }
  54. // When a remote server returns no body with a status of 204, we shall not decode it.
  55. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  56. // FormatException when trying to decode an empty string.
  57. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  58. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CreateProfileImageResponseDto',) as CreateProfileImageResponseDto;
  59. }
  60. return null;
  61. }
  62. /// Performs an HTTP 'POST /user' operation and returns the [Response].
  63. /// Parameters:
  64. ///
  65. /// * [CreateUserDto] createUserDto (required):
  66. Future<Response> createUserWithHttpInfo(CreateUserDto createUserDto,) async {
  67. // ignore: prefer_const_declarations
  68. final path = r'/user';
  69. // ignore: prefer_final_locals
  70. Object? postBody = createUserDto;
  71. final queryParams = <QueryParam>[];
  72. final headerParams = <String, String>{};
  73. final formParams = <String, String>{};
  74. const contentTypes = <String>['application/json'];
  75. return apiClient.invokeAPI(
  76. path,
  77. 'POST',
  78. queryParams,
  79. postBody,
  80. headerParams,
  81. formParams,
  82. contentTypes.isEmpty ? null : contentTypes.first,
  83. );
  84. }
  85. /// Parameters:
  86. ///
  87. /// * [CreateUserDto] createUserDto (required):
  88. Future<UserResponseDto?> createUser(CreateUserDto createUserDto,) async {
  89. final response = await createUserWithHttpInfo(createUserDto,);
  90. if (response.statusCode >= HttpStatus.badRequest) {
  91. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  92. }
  93. // When a remote server returns no body with a status of 204, we shall not decode it.
  94. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  95. // FormatException when trying to decode an empty string.
  96. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  97. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
  98. }
  99. return null;
  100. }
  101. /// Performs an HTTP 'DELETE /user/{userId}' operation and returns the [Response].
  102. /// Parameters:
  103. ///
  104. /// * [String] userId (required):
  105. Future<Response> deleteUserWithHttpInfo(String userId,) async {
  106. // ignore: prefer_const_declarations
  107. final path = r'/user/{userId}'
  108. .replaceAll('{userId}', userId);
  109. // ignore: prefer_final_locals
  110. Object? postBody;
  111. final queryParams = <QueryParam>[];
  112. final headerParams = <String, String>{};
  113. final formParams = <String, String>{};
  114. const contentTypes = <String>[];
  115. return apiClient.invokeAPI(
  116. path,
  117. 'DELETE',
  118. queryParams,
  119. postBody,
  120. headerParams,
  121. formParams,
  122. contentTypes.isEmpty ? null : contentTypes.first,
  123. );
  124. }
  125. /// Parameters:
  126. ///
  127. /// * [String] userId (required):
  128. Future<UserResponseDto?> deleteUser(String userId,) async {
  129. final response = await deleteUserWithHttpInfo(userId,);
  130. if (response.statusCode >= HttpStatus.badRequest) {
  131. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  132. }
  133. // When a remote server returns no body with a status of 204, we shall not decode it.
  134. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  135. // FormatException when trying to decode an empty string.
  136. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  137. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
  138. }
  139. return null;
  140. }
  141. /// Performs an HTTP 'GET /user' operation and returns the [Response].
  142. /// Parameters:
  143. ///
  144. /// * [bool] isAll (required):
  145. Future<Response> getAllUsersWithHttpInfo(bool isAll,) async {
  146. // ignore: prefer_const_declarations
  147. final path = r'/user';
  148. // ignore: prefer_final_locals
  149. Object? postBody;
  150. final queryParams = <QueryParam>[];
  151. final headerParams = <String, String>{};
  152. final formParams = <String, String>{};
  153. queryParams.addAll(_queryParams('', 'isAll', isAll));
  154. const contentTypes = <String>[];
  155. return apiClient.invokeAPI(
  156. path,
  157. 'GET',
  158. queryParams,
  159. postBody,
  160. headerParams,
  161. formParams,
  162. contentTypes.isEmpty ? null : contentTypes.first,
  163. );
  164. }
  165. /// Parameters:
  166. ///
  167. /// * [bool] isAll (required):
  168. Future<List<UserResponseDto>?> getAllUsers(bool isAll,) async {
  169. final response = await getAllUsersWithHttpInfo(isAll,);
  170. if (response.statusCode >= HttpStatus.badRequest) {
  171. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  172. }
  173. // When a remote server returns no body with a status of 204, we shall not decode it.
  174. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  175. // FormatException when trying to decode an empty string.
  176. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  177. final responseBody = await _decodeBodyBytes(response);
  178. return (await apiClient.deserializeAsync(responseBody, 'List<UserResponseDto>') as List)
  179. .cast<UserResponseDto>()
  180. .toList();
  181. }
  182. return null;
  183. }
  184. /// Performs an HTTP 'GET /user/me' operation and returns the [Response].
  185. Future<Response> getMyUserInfoWithHttpInfo() async {
  186. // ignore: prefer_const_declarations
  187. final path = r'/user/me';
  188. // ignore: prefer_final_locals
  189. Object? postBody;
  190. final queryParams = <QueryParam>[];
  191. final headerParams = <String, String>{};
  192. final formParams = <String, String>{};
  193. const contentTypes = <String>[];
  194. return apiClient.invokeAPI(
  195. path,
  196. 'GET',
  197. queryParams,
  198. postBody,
  199. headerParams,
  200. formParams,
  201. contentTypes.isEmpty ? null : contentTypes.first,
  202. );
  203. }
  204. Future<UserResponseDto?> getMyUserInfo() async {
  205. final response = await getMyUserInfoWithHttpInfo();
  206. if (response.statusCode >= HttpStatus.badRequest) {
  207. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  208. }
  209. // When a remote server returns no body with a status of 204, we shall not decode it.
  210. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  211. // FormatException when trying to decode an empty string.
  212. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  213. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
  214. }
  215. return null;
  216. }
  217. /// Performs an HTTP 'GET /user/profile-image/{userId}' operation and returns the [Response].
  218. /// Parameters:
  219. ///
  220. /// * [String] userId (required):
  221. Future<Response> getProfileImageWithHttpInfo(String userId,) async {
  222. // ignore: prefer_const_declarations
  223. final path = r'/user/profile-image/{userId}'
  224. .replaceAll('{userId}', userId);
  225. // ignore: prefer_final_locals
  226. Object? postBody;
  227. final queryParams = <QueryParam>[];
  228. final headerParams = <String, String>{};
  229. final formParams = <String, String>{};
  230. const contentTypes = <String>[];
  231. return apiClient.invokeAPI(
  232. path,
  233. 'GET',
  234. queryParams,
  235. postBody,
  236. headerParams,
  237. formParams,
  238. contentTypes.isEmpty ? null : contentTypes.first,
  239. );
  240. }
  241. /// Parameters:
  242. ///
  243. /// * [String] userId (required):
  244. Future<Object?> getProfileImage(String userId,) async {
  245. final response = await getProfileImageWithHttpInfo(userId,);
  246. if (response.statusCode >= HttpStatus.badRequest) {
  247. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  248. }
  249. // When a remote server returns no body with a status of 204, we shall not decode it.
  250. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  251. // FormatException when trying to decode an empty string.
  252. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  253. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  254. }
  255. return null;
  256. }
  257. /// Performs an HTTP 'GET /user/info/{userId}' operation and returns the [Response].
  258. /// Parameters:
  259. ///
  260. /// * [String] userId (required):
  261. Future<Response> getUserByIdWithHttpInfo(String userId,) async {
  262. // ignore: prefer_const_declarations
  263. final path = r'/user/info/{userId}'
  264. .replaceAll('{userId}', userId);
  265. // ignore: prefer_final_locals
  266. Object? postBody;
  267. final queryParams = <QueryParam>[];
  268. final headerParams = <String, String>{};
  269. final formParams = <String, String>{};
  270. const contentTypes = <String>[];
  271. return apiClient.invokeAPI(
  272. path,
  273. 'GET',
  274. queryParams,
  275. postBody,
  276. headerParams,
  277. formParams,
  278. contentTypes.isEmpty ? null : contentTypes.first,
  279. );
  280. }
  281. /// Parameters:
  282. ///
  283. /// * [String] userId (required):
  284. Future<UserResponseDto?> getUserById(String userId,) async {
  285. final response = await getUserByIdWithHttpInfo(userId,);
  286. if (response.statusCode >= HttpStatus.badRequest) {
  287. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  288. }
  289. // When a remote server returns no body with a status of 204, we shall not decode it.
  290. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  291. // FormatException when trying to decode an empty string.
  292. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  293. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
  294. }
  295. return null;
  296. }
  297. /// Performs an HTTP 'GET /user/count' operation and returns the [Response].
  298. Future<Response> getUserCountWithHttpInfo() async {
  299. // ignore: prefer_const_declarations
  300. final path = r'/user/count';
  301. // ignore: prefer_final_locals
  302. Object? postBody;
  303. final queryParams = <QueryParam>[];
  304. final headerParams = <String, String>{};
  305. final formParams = <String, String>{};
  306. const contentTypes = <String>[];
  307. return apiClient.invokeAPI(
  308. path,
  309. 'GET',
  310. queryParams,
  311. postBody,
  312. headerParams,
  313. formParams,
  314. contentTypes.isEmpty ? null : contentTypes.first,
  315. );
  316. }
  317. Future<UserCountResponseDto?> getUserCount() async {
  318. final response = await getUserCountWithHttpInfo();
  319. if (response.statusCode >= HttpStatus.badRequest) {
  320. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  321. }
  322. // When a remote server returns no body with a status of 204, we shall not decode it.
  323. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  324. // FormatException when trying to decode an empty string.
  325. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  326. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserCountResponseDto',) as UserCountResponseDto;
  327. }
  328. return null;
  329. }
  330. /// Performs an HTTP 'POST /user/{userId}/restore' operation and returns the [Response].
  331. /// Parameters:
  332. ///
  333. /// * [String] userId (required):
  334. Future<Response> restoreUserWithHttpInfo(String userId,) async {
  335. // ignore: prefer_const_declarations
  336. final path = r'/user/{userId}/restore'
  337. .replaceAll('{userId}', userId);
  338. // ignore: prefer_final_locals
  339. Object? postBody;
  340. final queryParams = <QueryParam>[];
  341. final headerParams = <String, String>{};
  342. final formParams = <String, String>{};
  343. const contentTypes = <String>[];
  344. return apiClient.invokeAPI(
  345. path,
  346. 'POST',
  347. queryParams,
  348. postBody,
  349. headerParams,
  350. formParams,
  351. contentTypes.isEmpty ? null : contentTypes.first,
  352. );
  353. }
  354. /// Parameters:
  355. ///
  356. /// * [String] userId (required):
  357. Future<UserResponseDto?> restoreUser(String userId,) async {
  358. final response = await restoreUserWithHttpInfo(userId,);
  359. if (response.statusCode >= HttpStatus.badRequest) {
  360. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  361. }
  362. // When a remote server returns no body with a status of 204, we shall not decode it.
  363. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  364. // FormatException when trying to decode an empty string.
  365. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  366. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
  367. }
  368. return null;
  369. }
  370. /// Performs an HTTP 'PUT /user' operation and returns the [Response].
  371. /// Parameters:
  372. ///
  373. /// * [UpdateUserDto] updateUserDto (required):
  374. Future<Response> updateUserWithHttpInfo(UpdateUserDto updateUserDto,) async {
  375. // ignore: prefer_const_declarations
  376. final path = r'/user';
  377. // ignore: prefer_final_locals
  378. Object? postBody = updateUserDto;
  379. final queryParams = <QueryParam>[];
  380. final headerParams = <String, String>{};
  381. final formParams = <String, String>{};
  382. const contentTypes = <String>['application/json'];
  383. return apiClient.invokeAPI(
  384. path,
  385. 'PUT',
  386. queryParams,
  387. postBody,
  388. headerParams,
  389. formParams,
  390. contentTypes.isEmpty ? null : contentTypes.first,
  391. );
  392. }
  393. /// Parameters:
  394. ///
  395. /// * [UpdateUserDto] updateUserDto (required):
  396. Future<UserResponseDto?> updateUser(UpdateUserDto updateUserDto,) async {
  397. final response = await updateUserWithHttpInfo(updateUserDto,);
  398. if (response.statusCode >= HttpStatus.badRequest) {
  399. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  400. }
  401. // When a remote server returns no body with a status of 204, we shall not decode it.
  402. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  403. // FormatException when trying to decode an empty string.
  404. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  405. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
  406. }
  407. return null;
  408. }
  409. }