server_info_api.dart 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. /// Performs an HTTP 'GET /server-info/config' operation and returns the [Response].
  14. Future<Response> getServerConfigWithHttpInfo() async {
  15. // ignore: prefer_const_declarations
  16. final path = r'/server-info/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<ServerConfigDto?> getServerConfig() async {
  34. final response = await getServerConfigWithHttpInfo();
  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), 'ServerConfigDto',) as ServerConfigDto;
  43. }
  44. return null;
  45. }
  46. /// Performs an HTTP 'GET /server-info/features' operation and returns the [Response].
  47. Future<Response> getServerFeaturesWithHttpInfo() async {
  48. // ignore: prefer_const_declarations
  49. final path = r'/server-info/features';
  50. // ignore: prefer_final_locals
  51. Object? postBody;
  52. final queryParams = <QueryParam>[];
  53. final headerParams = <String, String>{};
  54. final formParams = <String, String>{};
  55. const contentTypes = <String>[];
  56. return apiClient.invokeAPI(
  57. path,
  58. 'GET',
  59. queryParams,
  60. postBody,
  61. headerParams,
  62. formParams,
  63. contentTypes.isEmpty ? null : contentTypes.first,
  64. );
  65. }
  66. Future<ServerFeaturesDto?> getServerFeatures() async {
  67. final response = await getServerFeaturesWithHttpInfo();
  68. if (response.statusCode >= HttpStatus.badRequest) {
  69. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  70. }
  71. // When a remote server returns no body with a status of 204, we shall not decode it.
  72. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  73. // FormatException when trying to decode an empty string.
  74. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  75. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerFeaturesDto',) as ServerFeaturesDto;
  76. }
  77. return null;
  78. }
  79. /// Performs an HTTP 'GET /server-info' operation and returns the [Response].
  80. Future<Response> getServerInfoWithHttpInfo() async {
  81. // ignore: prefer_const_declarations
  82. final path = r'/server-info';
  83. // ignore: prefer_final_locals
  84. Object? postBody;
  85. final queryParams = <QueryParam>[];
  86. final headerParams = <String, String>{};
  87. final formParams = <String, String>{};
  88. const contentTypes = <String>[];
  89. return apiClient.invokeAPI(
  90. path,
  91. 'GET',
  92. queryParams,
  93. postBody,
  94. headerParams,
  95. formParams,
  96. contentTypes.isEmpty ? null : contentTypes.first,
  97. );
  98. }
  99. Future<ServerInfoResponseDto?> getServerInfo() async {
  100. final response = await getServerInfoWithHttpInfo();
  101. if (response.statusCode >= HttpStatus.badRequest) {
  102. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  103. }
  104. // When a remote server returns no body with a status of 204, we shall not decode it.
  105. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  106. // FormatException when trying to decode an empty string.
  107. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  108. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerInfoResponseDto',) as ServerInfoResponseDto;
  109. }
  110. return null;
  111. }
  112. /// Performs an HTTP 'GET /server-info/version' operation and returns the [Response].
  113. Future<Response> getServerVersionWithHttpInfo() async {
  114. // ignore: prefer_const_declarations
  115. final path = r'/server-info/version';
  116. // ignore: prefer_final_locals
  117. Object? postBody;
  118. final queryParams = <QueryParam>[];
  119. final headerParams = <String, String>{};
  120. final formParams = <String, String>{};
  121. const contentTypes = <String>[];
  122. return apiClient.invokeAPI(
  123. path,
  124. 'GET',
  125. queryParams,
  126. postBody,
  127. headerParams,
  128. formParams,
  129. contentTypes.isEmpty ? null : contentTypes.first,
  130. );
  131. }
  132. Future<ServerVersionResponseDto?> getServerVersion() async {
  133. final response = await getServerVersionWithHttpInfo();
  134. if (response.statusCode >= HttpStatus.badRequest) {
  135. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  136. }
  137. // When a remote server returns no body with a status of 204, we shall not decode it.
  138. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  139. // FormatException when trying to decode an empty string.
  140. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  141. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerVersionResponseDto',) as ServerVersionResponseDto;
  142. }
  143. return null;
  144. }
  145. /// Performs an HTTP 'GET /server-info/stats' operation and returns the [Response].
  146. Future<Response> getStatsWithHttpInfo() async {
  147. // ignore: prefer_const_declarations
  148. final path = r'/server-info/stats';
  149. // ignore: prefer_final_locals
  150. Object? postBody;
  151. final queryParams = <QueryParam>[];
  152. final headerParams = <String, String>{};
  153. final formParams = <String, String>{};
  154. const contentTypes = <String>[];
  155. return apiClient.invokeAPI(
  156. path,
  157. 'GET',
  158. queryParams,
  159. postBody,
  160. headerParams,
  161. formParams,
  162. contentTypes.isEmpty ? null : contentTypes.first,
  163. );
  164. }
  165. Future<ServerStatsResponseDto?> getStats() async {
  166. final response = await getStatsWithHttpInfo();
  167. if (response.statusCode >= HttpStatus.badRequest) {
  168. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  169. }
  170. // When a remote server returns no body with a status of 204, we shall not decode it.
  171. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  172. // FormatException when trying to decode an empty string.
  173. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  174. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerStatsResponseDto',) as ServerStatsResponseDto;
  175. }
  176. return null;
  177. }
  178. /// Performs an HTTP 'GET /server-info/media-types' operation and returns the [Response].
  179. Future<Response> getSupportedMediaTypesWithHttpInfo() async {
  180. // ignore: prefer_const_declarations
  181. final path = r'/server-info/media-types';
  182. // ignore: prefer_final_locals
  183. Object? postBody;
  184. final queryParams = <QueryParam>[];
  185. final headerParams = <String, String>{};
  186. final formParams = <String, String>{};
  187. const contentTypes = <String>[];
  188. return apiClient.invokeAPI(
  189. path,
  190. 'GET',
  191. queryParams,
  192. postBody,
  193. headerParams,
  194. formParams,
  195. contentTypes.isEmpty ? null : contentTypes.first,
  196. );
  197. }
  198. Future<ServerMediaTypesResponseDto?> getSupportedMediaTypes() async {
  199. final response = await getSupportedMediaTypesWithHttpInfo();
  200. if (response.statusCode >= HttpStatus.badRequest) {
  201. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  202. }
  203. // When a remote server returns no body with a status of 204, we shall not decode it.
  204. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  205. // FormatException when trying to decode an empty string.
  206. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  207. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerMediaTypesResponseDto',) as ServerMediaTypesResponseDto;
  208. }
  209. return null;
  210. }
  211. /// Performs an HTTP 'GET /server-info/theme' operation and returns the [Response].
  212. Future<Response> getThemeWithHttpInfo() async {
  213. // ignore: prefer_const_declarations
  214. final path = r'/server-info/theme';
  215. // ignore: prefer_final_locals
  216. Object? postBody;
  217. final queryParams = <QueryParam>[];
  218. final headerParams = <String, String>{};
  219. final formParams = <String, String>{};
  220. const contentTypes = <String>[];
  221. return apiClient.invokeAPI(
  222. path,
  223. 'GET',
  224. queryParams,
  225. postBody,
  226. headerParams,
  227. formParams,
  228. contentTypes.isEmpty ? null : contentTypes.first,
  229. );
  230. }
  231. Future<ServerThemeDto?> getTheme() async {
  232. final response = await getThemeWithHttpInfo();
  233. if (response.statusCode >= HttpStatus.badRequest) {
  234. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  235. }
  236. // When a remote server returns no body with a status of 204, we shall not decode it.
  237. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  238. // FormatException when trying to decode an empty string.
  239. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  240. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerThemeDto',) as ServerThemeDto;
  241. }
  242. return null;
  243. }
  244. /// Performs an HTTP 'GET /server-info/ping' operation and returns the [Response].
  245. Future<Response> pingServerWithHttpInfo() async {
  246. // ignore: prefer_const_declarations
  247. final path = r'/server-info/ping';
  248. // ignore: prefer_final_locals
  249. Object? postBody;
  250. final queryParams = <QueryParam>[];
  251. final headerParams = <String, String>{};
  252. final formParams = <String, String>{};
  253. const contentTypes = <String>[];
  254. return apiClient.invokeAPI(
  255. path,
  256. 'GET',
  257. queryParams,
  258. postBody,
  259. headerParams,
  260. formParams,
  261. contentTypes.isEmpty ? null : contentTypes.first,
  262. );
  263. }
  264. Future<ServerPingResponse?> pingServer() async {
  265. final response = await pingServerWithHttpInfo();
  266. if (response.statusCode >= HttpStatus.badRequest) {
  267. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  268. }
  269. // When a remote server returns no body with a status of 204, we shall not decode it.
  270. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  271. // FormatException when trying to decode an empty string.
  272. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  273. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerPingResponse',) as ServerPingResponse;
  274. }
  275. return null;
  276. }
  277. }