person_api.dart 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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 PersonApi {
  11. PersonApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'GET /person' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [bool] withHidden:
  17. Future<Response> getAllPeopleWithHttpInfo({ bool? withHidden, }) async {
  18. // ignore: prefer_const_declarations
  19. final path = r'/person';
  20. // ignore: prefer_final_locals
  21. Object? postBody;
  22. final queryParams = <QueryParam>[];
  23. final headerParams = <String, String>{};
  24. final formParams = <String, String>{};
  25. if (withHidden != null) {
  26. queryParams.addAll(_queryParams('', 'withHidden', withHidden));
  27. }
  28. const contentTypes = <String>[];
  29. return apiClient.invokeAPI(
  30. path,
  31. 'GET',
  32. queryParams,
  33. postBody,
  34. headerParams,
  35. formParams,
  36. contentTypes.isEmpty ? null : contentTypes.first,
  37. );
  38. }
  39. /// Parameters:
  40. ///
  41. /// * [bool] withHidden:
  42. Future<PeopleResponseDto?> getAllPeople({ bool? withHidden, }) async {
  43. final response = await getAllPeopleWithHttpInfo( withHidden: withHidden, );
  44. if (response.statusCode >= HttpStatus.badRequest) {
  45. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  46. }
  47. // When a remote server returns no body with a status of 204, we shall not decode it.
  48. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  49. // FormatException when trying to decode an empty string.
  50. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  51. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PeopleResponseDto',) as PeopleResponseDto;
  52. }
  53. return null;
  54. }
  55. /// Performs an HTTP 'GET /person/{id}' operation and returns the [Response].
  56. /// Parameters:
  57. ///
  58. /// * [String] id (required):
  59. Future<Response> getPersonWithHttpInfo(String id,) async {
  60. // ignore: prefer_const_declarations
  61. final path = r'/person/{id}'
  62. .replaceAll('{id}', id);
  63. // ignore: prefer_final_locals
  64. Object? postBody;
  65. final queryParams = <QueryParam>[];
  66. final headerParams = <String, String>{};
  67. final formParams = <String, String>{};
  68. const contentTypes = <String>[];
  69. return apiClient.invokeAPI(
  70. path,
  71. 'GET',
  72. queryParams,
  73. postBody,
  74. headerParams,
  75. formParams,
  76. contentTypes.isEmpty ? null : contentTypes.first,
  77. );
  78. }
  79. /// Parameters:
  80. ///
  81. /// * [String] id (required):
  82. Future<PersonResponseDto?> getPerson(String id,) async {
  83. final response = await getPersonWithHttpInfo(id,);
  84. if (response.statusCode >= HttpStatus.badRequest) {
  85. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  86. }
  87. // When a remote server returns no body with a status of 204, we shall not decode it.
  88. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  89. // FormatException when trying to decode an empty string.
  90. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  91. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PersonResponseDto',) as PersonResponseDto;
  92. }
  93. return null;
  94. }
  95. /// Performs an HTTP 'GET /person/{id}/assets' operation and returns the [Response].
  96. /// Parameters:
  97. ///
  98. /// * [String] id (required):
  99. Future<Response> getPersonAssetsWithHttpInfo(String id,) async {
  100. // ignore: prefer_const_declarations
  101. final path = r'/person/{id}/assets'
  102. .replaceAll('{id}', id);
  103. // ignore: prefer_final_locals
  104. Object? postBody;
  105. final queryParams = <QueryParam>[];
  106. final headerParams = <String, String>{};
  107. final formParams = <String, String>{};
  108. const contentTypes = <String>[];
  109. return apiClient.invokeAPI(
  110. path,
  111. 'GET',
  112. queryParams,
  113. postBody,
  114. headerParams,
  115. formParams,
  116. contentTypes.isEmpty ? null : contentTypes.first,
  117. );
  118. }
  119. /// Parameters:
  120. ///
  121. /// * [String] id (required):
  122. Future<List<AssetResponseDto>?> getPersonAssets(String id,) async {
  123. final response = await getPersonAssetsWithHttpInfo(id,);
  124. if (response.statusCode >= HttpStatus.badRequest) {
  125. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  126. }
  127. // When a remote server returns no body with a status of 204, we shall not decode it.
  128. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  129. // FormatException when trying to decode an empty string.
  130. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  131. final responseBody = await _decodeBodyBytes(response);
  132. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  133. .cast<AssetResponseDto>()
  134. .toList();
  135. }
  136. return null;
  137. }
  138. /// Performs an HTTP 'GET /person/{id}/thumbnail' operation and returns the [Response].
  139. /// Parameters:
  140. ///
  141. /// * [String] id (required):
  142. Future<Response> getPersonThumbnailWithHttpInfo(String id,) async {
  143. // ignore: prefer_const_declarations
  144. final path = r'/person/{id}/thumbnail'
  145. .replaceAll('{id}', id);
  146. // ignore: prefer_final_locals
  147. Object? postBody;
  148. final queryParams = <QueryParam>[];
  149. final headerParams = <String, String>{};
  150. final formParams = <String, String>{};
  151. const contentTypes = <String>[];
  152. return apiClient.invokeAPI(
  153. path,
  154. 'GET',
  155. queryParams,
  156. postBody,
  157. headerParams,
  158. formParams,
  159. contentTypes.isEmpty ? null : contentTypes.first,
  160. );
  161. }
  162. /// Parameters:
  163. ///
  164. /// * [String] id (required):
  165. Future<MultipartFile?> getPersonThumbnail(String id,) async {
  166. final response = await getPersonThumbnailWithHttpInfo(id,);
  167. if (response.statusCode >= HttpStatus.badRequest) {
  168. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  169. }
  170. // When a remote server returns no body with a status of 204, we shall not decode it.
  171. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  172. // FormatException when trying to decode an empty string.
  173. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  174. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  175. }
  176. return null;
  177. }
  178. /// Performs an HTTP 'POST /person/{id}/merge' operation and returns the [Response].
  179. /// Parameters:
  180. ///
  181. /// * [String] id (required):
  182. ///
  183. /// * [MergePersonDto] mergePersonDto (required):
  184. Future<Response> mergePersonWithHttpInfo(String id, MergePersonDto mergePersonDto,) async {
  185. // ignore: prefer_const_declarations
  186. final path = r'/person/{id}/merge'
  187. .replaceAll('{id}', id);
  188. // ignore: prefer_final_locals
  189. Object? postBody = mergePersonDto;
  190. final queryParams = <QueryParam>[];
  191. final headerParams = <String, String>{};
  192. final formParams = <String, String>{};
  193. const contentTypes = <String>['application/json'];
  194. return apiClient.invokeAPI(
  195. path,
  196. 'POST',
  197. queryParams,
  198. postBody,
  199. headerParams,
  200. formParams,
  201. contentTypes.isEmpty ? null : contentTypes.first,
  202. );
  203. }
  204. /// Parameters:
  205. ///
  206. /// * [String] id (required):
  207. ///
  208. /// * [MergePersonDto] mergePersonDto (required):
  209. Future<List<BulkIdResponseDto>?> mergePerson(String id, MergePersonDto mergePersonDto,) async {
  210. final response = await mergePersonWithHttpInfo(id, mergePersonDto,);
  211. if (response.statusCode >= HttpStatus.badRequest) {
  212. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  213. }
  214. // When a remote server returns no body with a status of 204, we shall not decode it.
  215. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  216. // FormatException when trying to decode an empty string.
  217. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  218. final responseBody = await _decodeBodyBytes(response);
  219. return (await apiClient.deserializeAsync(responseBody, 'List<BulkIdResponseDto>') as List)
  220. .cast<BulkIdResponseDto>()
  221. .toList();
  222. }
  223. return null;
  224. }
  225. /// Performs an HTTP 'PUT /person/{id}' operation and returns the [Response].
  226. /// Parameters:
  227. ///
  228. /// * [String] id (required):
  229. ///
  230. /// * [PersonUpdateDto] personUpdateDto (required):
  231. Future<Response> updatePersonWithHttpInfo(String id, PersonUpdateDto personUpdateDto,) async {
  232. // ignore: prefer_const_declarations
  233. final path = r'/person/{id}'
  234. .replaceAll('{id}', id);
  235. // ignore: prefer_final_locals
  236. Object? postBody = personUpdateDto;
  237. final queryParams = <QueryParam>[];
  238. final headerParams = <String, String>{};
  239. final formParams = <String, String>{};
  240. const contentTypes = <String>['application/json'];
  241. return apiClient.invokeAPI(
  242. path,
  243. 'PUT',
  244. queryParams,
  245. postBody,
  246. headerParams,
  247. formParams,
  248. contentTypes.isEmpty ? null : contentTypes.first,
  249. );
  250. }
  251. /// Parameters:
  252. ///
  253. /// * [String] id (required):
  254. ///
  255. /// * [PersonUpdateDto] personUpdateDto (required):
  256. Future<PersonResponseDto?> updatePerson(String id, PersonUpdateDto personUpdateDto,) async {
  257. final response = await updatePersonWithHttpInfo(id, personUpdateDto,);
  258. if (response.statusCode >= HttpStatus.badRequest) {
  259. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  260. }
  261. // When a remote server returns no body with a status of 204, we shall not decode it.
  262. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  263. // FormatException when trying to decode an empty string.
  264. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  265. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PersonResponseDto',) as PersonResponseDto;
  266. }
  267. return null;
  268. }
  269. }