face_api.dart 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 FaceApi {
  11. FaceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'GET /face' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [String] id (required):
  17. Future<Response> getFacesWithHttpInfo(String id,) async {
  18. // ignore: prefer_const_declarations
  19. final path = r'/face';
  20. // ignore: prefer_final_locals
  21. Object? postBody;
  22. final queryParams = <QueryParam>[];
  23. final headerParams = <String, String>{};
  24. final formParams = <String, String>{};
  25. queryParams.addAll(_queryParams('', 'id', id));
  26. const contentTypes = <String>[];
  27. return apiClient.invokeAPI(
  28. path,
  29. 'GET',
  30. queryParams,
  31. postBody,
  32. headerParams,
  33. formParams,
  34. contentTypes.isEmpty ? null : contentTypes.first,
  35. );
  36. }
  37. /// Parameters:
  38. ///
  39. /// * [String] id (required):
  40. Future<List<AssetFaceResponseDto>?> getFaces(String id,) async {
  41. final response = await getFacesWithHttpInfo(id,);
  42. if (response.statusCode >= HttpStatus.badRequest) {
  43. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  44. }
  45. // When a remote server returns no body with a status of 204, we shall not decode it.
  46. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  47. // FormatException when trying to decode an empty string.
  48. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  49. final responseBody = await _decodeBodyBytes(response);
  50. return (await apiClient.deserializeAsync(responseBody, 'List<AssetFaceResponseDto>') as List)
  51. .cast<AssetFaceResponseDto>()
  52. .toList();
  53. }
  54. return null;
  55. }
  56. /// Performs an HTTP 'PUT /face/{id}' operation and returns the [Response].
  57. /// Parameters:
  58. ///
  59. /// * [String] id (required):
  60. ///
  61. /// * [FaceDto] faceDto (required):
  62. Future<Response> reassignFacesByIdWithHttpInfo(String id, FaceDto faceDto,) async {
  63. // ignore: prefer_const_declarations
  64. final path = r'/face/{id}'
  65. .replaceAll('{id}', id);
  66. // ignore: prefer_final_locals
  67. Object? postBody = faceDto;
  68. final queryParams = <QueryParam>[];
  69. final headerParams = <String, String>{};
  70. final formParams = <String, String>{};
  71. const contentTypes = <String>['application/json'];
  72. return apiClient.invokeAPI(
  73. path,
  74. 'PUT',
  75. queryParams,
  76. postBody,
  77. headerParams,
  78. formParams,
  79. contentTypes.isEmpty ? null : contentTypes.first,
  80. );
  81. }
  82. /// Parameters:
  83. ///
  84. /// * [String] id (required):
  85. ///
  86. /// * [FaceDto] faceDto (required):
  87. Future<PersonResponseDto?> reassignFacesById(String id, FaceDto faceDto,) async {
  88. final response = await reassignFacesByIdWithHttpInfo(id, faceDto,);
  89. if (response.statusCode >= HttpStatus.badRequest) {
  90. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  91. }
  92. // When a remote server returns no body with a status of 204, we shall not decode it.
  93. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  94. // FormatException when trying to decode an empty string.
  95. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  96. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PersonResponseDto',) as PersonResponseDto;
  97. }
  98. return null;
  99. }
  100. /// Performs an HTTP 'DELETE /face/{id}' operation and returns the [Response].
  101. /// Parameters:
  102. ///
  103. /// * [String] id (required):
  104. Future<Response> unassignFaceWithHttpInfo(String id,) async {
  105. // ignore: prefer_const_declarations
  106. final path = r'/face/{id}'
  107. .replaceAll('{id}', id);
  108. // ignore: prefer_final_locals
  109. Object? postBody;
  110. final queryParams = <QueryParam>[];
  111. final headerParams = <String, String>{};
  112. final formParams = <String, String>{};
  113. const contentTypes = <String>[];
  114. return apiClient.invokeAPI(
  115. path,
  116. 'DELETE',
  117. queryParams,
  118. postBody,
  119. headerParams,
  120. formParams,
  121. contentTypes.isEmpty ? null : contentTypes.first,
  122. );
  123. }
  124. /// Parameters:
  125. ///
  126. /// * [String] id (required):
  127. Future<AssetFaceResponseDto?> unassignFace(String id,) async {
  128. final response = await unassignFaceWithHttpInfo(id,);
  129. if (response.statusCode >= HttpStatus.badRequest) {
  130. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  131. }
  132. // When a remote server returns no body with a status of 204, we shall not decode it.
  133. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  134. // FormatException when trying to decode an empty string.
  135. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  136. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFaceResponseDto',) as AssetFaceResponseDto;
  137. }
  138. return null;
  139. }
  140. }