audit_api.dart 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 AuditApi {
  11. AuditApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'POST /audit/file-report/fix' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [FileReportFixDto] fileReportFixDto (required):
  17. Future<Response> fixAuditFilesWithHttpInfo(FileReportFixDto fileReportFixDto,) async {
  18. // ignore: prefer_const_declarations
  19. final path = r'/audit/file-report/fix';
  20. // ignore: prefer_final_locals
  21. Object? postBody = fileReportFixDto;
  22. final queryParams = <QueryParam>[];
  23. final headerParams = <String, String>{};
  24. final formParams = <String, String>{};
  25. const contentTypes = <String>['application/json'];
  26. return apiClient.invokeAPI(
  27. path,
  28. 'POST',
  29. queryParams,
  30. postBody,
  31. headerParams,
  32. formParams,
  33. contentTypes.isEmpty ? null : contentTypes.first,
  34. );
  35. }
  36. /// Parameters:
  37. ///
  38. /// * [FileReportFixDto] fileReportFixDto (required):
  39. Future<void> fixAuditFiles(FileReportFixDto fileReportFixDto,) async {
  40. final response = await fixAuditFilesWithHttpInfo(fileReportFixDto,);
  41. if (response.statusCode >= HttpStatus.badRequest) {
  42. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  43. }
  44. }
  45. /// Performs an HTTP 'GET /audit/deletes' operation and returns the [Response].
  46. /// Parameters:
  47. ///
  48. /// * [EntityType] entityType (required):
  49. ///
  50. /// * [DateTime] after (required):
  51. ///
  52. /// * [String] userId:
  53. Future<Response> getAuditDeletesWithHttpInfo(EntityType entityType, DateTime after, { String? userId, }) async {
  54. // ignore: prefer_const_declarations
  55. final path = r'/audit/deletes';
  56. // ignore: prefer_final_locals
  57. Object? postBody;
  58. final queryParams = <QueryParam>[];
  59. final headerParams = <String, String>{};
  60. final formParams = <String, String>{};
  61. queryParams.addAll(_queryParams('', 'entityType', entityType));
  62. if (userId != null) {
  63. queryParams.addAll(_queryParams('', 'userId', userId));
  64. }
  65. queryParams.addAll(_queryParams('', 'after', after));
  66. const contentTypes = <String>[];
  67. return apiClient.invokeAPI(
  68. path,
  69. 'GET',
  70. queryParams,
  71. postBody,
  72. headerParams,
  73. formParams,
  74. contentTypes.isEmpty ? null : contentTypes.first,
  75. );
  76. }
  77. /// Parameters:
  78. ///
  79. /// * [EntityType] entityType (required):
  80. ///
  81. /// * [DateTime] after (required):
  82. ///
  83. /// * [String] userId:
  84. Future<AuditDeletesResponseDto?> getAuditDeletes(EntityType entityType, DateTime after, { String? userId, }) async {
  85. final response = await getAuditDeletesWithHttpInfo(entityType, after, userId: userId, );
  86. if (response.statusCode >= HttpStatus.badRequest) {
  87. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  88. }
  89. // When a remote server returns no body with a status of 204, we shall not decode it.
  90. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  91. // FormatException when trying to decode an empty string.
  92. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  93. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AuditDeletesResponseDto',) as AuditDeletesResponseDto;
  94. }
  95. return null;
  96. }
  97. /// Performs an HTTP 'GET /audit/file-report' operation and returns the [Response].
  98. Future<Response> getAuditFilesWithHttpInfo() async {
  99. // ignore: prefer_const_declarations
  100. final path = r'/audit/file-report';
  101. // ignore: prefer_final_locals
  102. Object? postBody;
  103. final queryParams = <QueryParam>[];
  104. final headerParams = <String, String>{};
  105. final formParams = <String, String>{};
  106. const contentTypes = <String>[];
  107. return apiClient.invokeAPI(
  108. path,
  109. 'GET',
  110. queryParams,
  111. postBody,
  112. headerParams,
  113. formParams,
  114. contentTypes.isEmpty ? null : contentTypes.first,
  115. );
  116. }
  117. Future<FileReportDto?> getAuditFiles() async {
  118. final response = await getAuditFilesWithHttpInfo();
  119. if (response.statusCode >= HttpStatus.badRequest) {
  120. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  121. }
  122. // When a remote server returns no body with a status of 204, we shall not decode it.
  123. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  124. // FormatException when trying to decode an empty string.
  125. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  126. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'FileReportDto',) as FileReportDto;
  127. }
  128. return null;
  129. }
  130. /// Performs an HTTP 'POST /audit/file-report/checksum' operation and returns the [Response].
  131. /// Parameters:
  132. ///
  133. /// * [FileChecksumDto] fileChecksumDto (required):
  134. Future<Response> getFileChecksumsWithHttpInfo(FileChecksumDto fileChecksumDto,) async {
  135. // ignore: prefer_const_declarations
  136. final path = r'/audit/file-report/checksum';
  137. // ignore: prefer_final_locals
  138. Object? postBody = fileChecksumDto;
  139. final queryParams = <QueryParam>[];
  140. final headerParams = <String, String>{};
  141. final formParams = <String, String>{};
  142. const contentTypes = <String>['application/json'];
  143. return apiClient.invokeAPI(
  144. path,
  145. 'POST',
  146. queryParams,
  147. postBody,
  148. headerParams,
  149. formParams,
  150. contentTypes.isEmpty ? null : contentTypes.first,
  151. );
  152. }
  153. /// Parameters:
  154. ///
  155. /// * [FileChecksumDto] fileChecksumDto (required):
  156. Future<List<FileChecksumResponseDto>?> getFileChecksums(FileChecksumDto fileChecksumDto,) async {
  157. final response = await getFileChecksumsWithHttpInfo(fileChecksumDto,);
  158. if (response.statusCode >= HttpStatus.badRequest) {
  159. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  160. }
  161. // When a remote server returns no body with a status of 204, we shall not decode it.
  162. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  163. // FormatException when trying to decode an empty string.
  164. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  165. final responseBody = await _decodeBodyBytes(response);
  166. return (await apiClient.deserializeAsync(responseBody, 'List<FileChecksumResponseDto>') as List)
  167. .cast<FileChecksumResponseDto>()
  168. .toList();
  169. }
  170. return null;
  171. }
  172. }