server_info_api.dart 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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 ServerInfoApi {
  11. ServerInfoApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. ///
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. Future<Response> getServerInfoWithHttpInfo() async {
  17. // ignore: prefer_const_declarations
  18. final path = r'/server-info';
  19. // ignore: prefer_final_locals
  20. Object? postBody;
  21. final queryParams = <QueryParam>[];
  22. final headerParams = <String, String>{};
  23. final formParams = <String, String>{};
  24. const contentTypes = <String>[];
  25. return apiClient.invokeAPI(
  26. path,
  27. 'GET',
  28. queryParams,
  29. postBody,
  30. headerParams,
  31. formParams,
  32. contentTypes.isEmpty ? null : contentTypes.first,
  33. );
  34. }
  35. ///
  36. Future<ServerInfoResponseDto?> getServerInfo() async {
  37. final response = await getServerInfoWithHttpInfo();
  38. if (response.statusCode >= HttpStatus.badRequest) {
  39. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  40. }
  41. // When a remote server returns no body with a status of 204, we shall not decode it.
  42. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  43. // FormatException when trying to decode an empty string.
  44. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  45. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerInfoResponseDto',) as ServerInfoResponseDto;
  46. }
  47. return null;
  48. }
  49. ///
  50. ///
  51. /// Note: This method returns the HTTP [Response].
  52. Future<Response> getServerVersionWithHttpInfo() async {
  53. // ignore: prefer_const_declarations
  54. final path = r'/server-info/version';
  55. // ignore: prefer_final_locals
  56. Object? postBody;
  57. final queryParams = <QueryParam>[];
  58. final headerParams = <String, String>{};
  59. final formParams = <String, String>{};
  60. const contentTypes = <String>[];
  61. return apiClient.invokeAPI(
  62. path,
  63. 'GET',
  64. queryParams,
  65. postBody,
  66. headerParams,
  67. formParams,
  68. contentTypes.isEmpty ? null : contentTypes.first,
  69. );
  70. }
  71. ///
  72. Future<ServerVersionReponseDto?> getServerVersion() async {
  73. final response = await getServerVersionWithHttpInfo();
  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), 'ServerVersionReponseDto',) as ServerVersionReponseDto;
  82. }
  83. return null;
  84. }
  85. ///
  86. ///
  87. /// Note: This method returns the HTTP [Response].
  88. Future<Response> getStatsWithHttpInfo() async {
  89. // ignore: prefer_const_declarations
  90. final path = r'/server-info/stats';
  91. // ignore: prefer_final_locals
  92. Object? postBody;
  93. final queryParams = <QueryParam>[];
  94. final headerParams = <String, String>{};
  95. final formParams = <String, String>{};
  96. const contentTypes = <String>[];
  97. return apiClient.invokeAPI(
  98. path,
  99. 'GET',
  100. queryParams,
  101. postBody,
  102. headerParams,
  103. formParams,
  104. contentTypes.isEmpty ? null : contentTypes.first,
  105. );
  106. }
  107. ///
  108. Future<ServerStatsResponseDto?> getStats() async {
  109. final response = await getStatsWithHttpInfo();
  110. if (response.statusCode >= HttpStatus.badRequest) {
  111. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  112. }
  113. // When a remote server returns no body with a status of 204, we shall not decode it.
  114. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  115. // FormatException when trying to decode an empty string.
  116. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  117. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerStatsResponseDto',) as ServerStatsResponseDto;
  118. }
  119. return null;
  120. }
  121. ///
  122. ///
  123. /// Note: This method returns the HTTP [Response].
  124. Future<Response> pingServerWithHttpInfo() async {
  125. // ignore: prefer_const_declarations
  126. final path = r'/server-info/ping';
  127. // ignore: prefer_final_locals
  128. Object? postBody;
  129. final queryParams = <QueryParam>[];
  130. final headerParams = <String, String>{};
  131. final formParams = <String, String>{};
  132. const contentTypes = <String>[];
  133. return apiClient.invokeAPI(
  134. path,
  135. 'GET',
  136. queryParams,
  137. postBody,
  138. headerParams,
  139. formParams,
  140. contentTypes.isEmpty ? null : contentTypes.first,
  141. );
  142. }
  143. ///
  144. Future<ServerPingResponse?> pingServer() async {
  145. final response = await pingServerWithHttpInfo();
  146. if (response.statusCode >= HttpStatus.badRequest) {
  147. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  148. }
  149. // When a remote server returns no body with a status of 204, we shall not decode it.
  150. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  151. // FormatException when trying to decode an empty string.
  152. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  153. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerPingResponse',) as ServerPingResponse;
  154. }
  155. return null;
  156. }
  157. }