person_api.dart 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. Future<Response> getAllPeopleWithHttpInfo() async {
  15. // ignore: prefer_const_declarations
  16. final path = r'/person';
  17. // ignore: prefer_final_locals
  18. Object? postBody;
  19. final queryParams = <QueryParam>[];
  20. final headerParams = <String, String>{};
  21. final formParams = <String, String>{};
  22. const contentTypes = <String>[];
  23. return apiClient.invokeAPI(
  24. path,
  25. 'GET',
  26. queryParams,
  27. postBody,
  28. headerParams,
  29. formParams,
  30. contentTypes.isEmpty ? null : contentTypes.first,
  31. );
  32. }
  33. Future<List<PersonResponseDto>?> getAllPeople() async {
  34. final response = await getAllPeopleWithHttpInfo();
  35. if (response.statusCode >= HttpStatus.badRequest) {
  36. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  37. }
  38. // When a remote server returns no body with a status of 204, we shall not decode it.
  39. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  40. // FormatException when trying to decode an empty string.
  41. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  42. final responseBody = await _decodeBodyBytes(response);
  43. return (await apiClient.deserializeAsync(responseBody, 'List<PersonResponseDto>') as List)
  44. .cast<PersonResponseDto>()
  45. .toList();
  46. }
  47. return null;
  48. }
  49. /// Performs an HTTP 'GET /person/{id}' operation and returns the [Response].
  50. /// Parameters:
  51. ///
  52. /// * [String] id (required):
  53. Future<Response> getPersonWithHttpInfo(String id,) async {
  54. // ignore: prefer_const_declarations
  55. final path = r'/person/{id}'
  56. .replaceAll('{id}', id);
  57. // ignore: prefer_final_locals
  58. Object? postBody;
  59. final queryParams = <QueryParam>[];
  60. final headerParams = <String, String>{};
  61. final formParams = <String, String>{};
  62. const contentTypes = <String>[];
  63. return apiClient.invokeAPI(
  64. path,
  65. 'GET',
  66. queryParams,
  67. postBody,
  68. headerParams,
  69. formParams,
  70. contentTypes.isEmpty ? null : contentTypes.first,
  71. );
  72. }
  73. /// Parameters:
  74. ///
  75. /// * [String] id (required):
  76. Future<PersonResponseDto?> getPerson(String id,) async {
  77. final response = await getPersonWithHttpInfo(id,);
  78. if (response.statusCode >= HttpStatus.badRequest) {
  79. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  80. }
  81. // When a remote server returns no body with a status of 204, we shall not decode it.
  82. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  83. // FormatException when trying to decode an empty string.
  84. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  85. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PersonResponseDto',) as PersonResponseDto;
  86. }
  87. return null;
  88. }
  89. /// Performs an HTTP 'GET /person/{id}/assets' operation and returns the [Response].
  90. /// Parameters:
  91. ///
  92. /// * [String] id (required):
  93. Future<Response> getPersonAssetsWithHttpInfo(String id,) async {
  94. // ignore: prefer_const_declarations
  95. final path = r'/person/{id}/assets'
  96. .replaceAll('{id}', id);
  97. // ignore: prefer_final_locals
  98. Object? postBody;
  99. final queryParams = <QueryParam>[];
  100. final headerParams = <String, String>{};
  101. final formParams = <String, String>{};
  102. const contentTypes = <String>[];
  103. return apiClient.invokeAPI(
  104. path,
  105. 'GET',
  106. queryParams,
  107. postBody,
  108. headerParams,
  109. formParams,
  110. contentTypes.isEmpty ? null : contentTypes.first,
  111. );
  112. }
  113. /// Parameters:
  114. ///
  115. /// * [String] id (required):
  116. Future<List<AssetResponseDto>?> getPersonAssets(String id,) async {
  117. final response = await getPersonAssetsWithHttpInfo(id,);
  118. if (response.statusCode >= HttpStatus.badRequest) {
  119. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  120. }
  121. // When a remote server returns no body with a status of 204, we shall not decode it.
  122. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  123. // FormatException when trying to decode an empty string.
  124. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  125. final responseBody = await _decodeBodyBytes(response);
  126. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  127. .cast<AssetResponseDto>()
  128. .toList();
  129. }
  130. return null;
  131. }
  132. /// Performs an HTTP 'GET /person/{id}/thumbnail' operation and returns the [Response].
  133. /// Parameters:
  134. ///
  135. /// * [String] id (required):
  136. Future<Response> getPersonThumbnailWithHttpInfo(String id,) async {
  137. // ignore: prefer_const_declarations
  138. final path = r'/person/{id}/thumbnail'
  139. .replaceAll('{id}', id);
  140. // ignore: prefer_final_locals
  141. Object? postBody;
  142. final queryParams = <QueryParam>[];
  143. final headerParams = <String, String>{};
  144. final formParams = <String, String>{};
  145. const contentTypes = <String>[];
  146. return apiClient.invokeAPI(
  147. path,
  148. 'GET',
  149. queryParams,
  150. postBody,
  151. headerParams,
  152. formParams,
  153. contentTypes.isEmpty ? null : contentTypes.first,
  154. );
  155. }
  156. /// Parameters:
  157. ///
  158. /// * [String] id (required):
  159. Future<void> getPersonThumbnail(String id,) async {
  160. final response = await getPersonThumbnailWithHttpInfo(id,);
  161. if (response.statusCode >= HttpStatus.badRequest) {
  162. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  163. }
  164. }
  165. /// Performs an HTTP 'PUT /person/{id}' operation and returns the [Response].
  166. /// Parameters:
  167. ///
  168. /// * [String] id (required):
  169. ///
  170. /// * [PersonUpdateDto] personUpdateDto (required):
  171. Future<Response> updatePersonWithHttpInfo(String id, PersonUpdateDto personUpdateDto,) async {
  172. // ignore: prefer_const_declarations
  173. final path = r'/person/{id}'
  174. .replaceAll('{id}', id);
  175. // ignore: prefer_final_locals
  176. Object? postBody = personUpdateDto;
  177. final queryParams = <QueryParam>[];
  178. final headerParams = <String, String>{};
  179. final formParams = <String, String>{};
  180. const contentTypes = <String>['application/json'];
  181. return apiClient.invokeAPI(
  182. path,
  183. 'PUT',
  184. queryParams,
  185. postBody,
  186. headerParams,
  187. formParams,
  188. contentTypes.isEmpty ? null : contentTypes.first,
  189. );
  190. }
  191. /// Parameters:
  192. ///
  193. /// * [String] id (required):
  194. ///
  195. /// * [PersonUpdateDto] personUpdateDto (required):
  196. Future<PersonResponseDto?> updatePerson(String id, PersonUpdateDto personUpdateDto,) async {
  197. final response = await updatePersonWithHttpInfo(id, personUpdateDto,);
  198. if (response.statusCode >= HttpStatus.badRequest) {
  199. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  200. }
  201. // When a remote server returns no body with a status of 204, we shall not decode it.
  202. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  203. // FormatException when trying to decode an empty string.
  204. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  205. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PersonResponseDto',) as PersonResponseDto;
  206. }
  207. return null;
  208. }
  209. }