system_config_api.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 SystemConfigApi {
  11. SystemConfigApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'GET /system-config' operation and returns the [Response].
  14. Future<Response> getConfigWithHttpInfo() async {
  15. // ignore: prefer_const_declarations
  16. final path = r'/system-config';
  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<SystemConfigResponseDto?> getConfig() async {
  34. final response = await getConfigWithHttpInfo();
  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. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigResponseDto',) as SystemConfigResponseDto;
  43. }
  44. return null;
  45. }
  46. /// Performs an HTTP 'PUT /system-config' operation and returns the [Response].
  47. /// Parameters:
  48. ///
  49. /// * [Object] body (required):
  50. Future<Response> updateConfigWithHttpInfo(Object body,) async {
  51. // ignore: prefer_const_declarations
  52. final path = r'/system-config';
  53. // ignore: prefer_final_locals
  54. Object? postBody = body;
  55. final queryParams = <QueryParam>[];
  56. final headerParams = <String, String>{};
  57. final formParams = <String, String>{};
  58. const contentTypes = <String>['application/json'];
  59. return apiClient.invokeAPI(
  60. path,
  61. 'PUT',
  62. queryParams,
  63. postBody,
  64. headerParams,
  65. formParams,
  66. contentTypes.isEmpty ? null : contentTypes.first,
  67. );
  68. }
  69. /// Parameters:
  70. ///
  71. /// * [Object] body (required):
  72. Future<SystemConfigResponseDto?> updateConfig(Object body,) async {
  73. final response = await updateConfigWithHttpInfo(body,);
  74. if (response.statusCode >= HttpStatus.badRequest) {
  75. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  76. }
  77. // When a remote server returns no body with a status of 204, we shall not decode it.
  78. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  79. // FormatException when trying to decode an empty string.
  80. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  81. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigResponseDto',) as SystemConfigResponseDto;
  82. }
  83. return null;
  84. }
  85. }