audit_api.dart 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 'GET /audit/deletes' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [EntityType] entityType (required):
  17. ///
  18. /// * [DateTime] after (required):
  19. ///
  20. /// * [String] userId:
  21. Future<Response> getAuditDeletesWithHttpInfo(EntityType entityType, DateTime after, { String? userId, }) async {
  22. // ignore: prefer_const_declarations
  23. final path = r'/audit/deletes';
  24. // ignore: prefer_final_locals
  25. Object? postBody;
  26. final queryParams = <QueryParam>[];
  27. final headerParams = <String, String>{};
  28. final formParams = <String, String>{};
  29. queryParams.addAll(_queryParams('', 'entityType', entityType));
  30. if (userId != null) {
  31. queryParams.addAll(_queryParams('', 'userId', userId));
  32. }
  33. queryParams.addAll(_queryParams('', 'after', after));
  34. const contentTypes = <String>[];
  35. return apiClient.invokeAPI(
  36. path,
  37. 'GET',
  38. queryParams,
  39. postBody,
  40. headerParams,
  41. formParams,
  42. contentTypes.isEmpty ? null : contentTypes.first,
  43. );
  44. }
  45. /// Parameters:
  46. ///
  47. /// * [EntityType] entityType (required):
  48. ///
  49. /// * [DateTime] after (required):
  50. ///
  51. /// * [String] userId:
  52. Future<AuditDeletesResponseDto?> getAuditDeletes(EntityType entityType, DateTime after, { String? userId, }) async {
  53. final response = await getAuditDeletesWithHttpInfo(entityType, after, userId: userId, );
  54. if (response.statusCode >= HttpStatus.badRequest) {
  55. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  56. }
  57. // When a remote server returns no body with a status of 204, we shall not decode it.
  58. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  59. // FormatException when trying to decode an empty string.
  60. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  61. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AuditDeletesResponseDto',) as AuditDeletesResponseDto;
  62. }
  63. return null;
  64. }
  65. }