job_api.dart 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 JobApi {
  11. JobApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'GET /jobs' operation and returns the [Response].
  14. Future<Response> getAllJobsStatusWithHttpInfo() async {
  15. // ignore: prefer_const_declarations
  16. final path = r'/jobs';
  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<AllJobStatusResponseDto?> getAllJobsStatus() async {
  34. final response = await getAllJobsStatusWithHttpInfo();
  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), 'AllJobStatusResponseDto',) as AllJobStatusResponseDto;
  43. }
  44. return null;
  45. }
  46. /// Performs an HTTP 'GET /jobs/{jobId}' operation and returns the [Response].
  47. /// Parameters:
  48. ///
  49. /// * [JobId] jobId (required):
  50. Future<Response> getJobStatusWithHttpInfo(JobId jobId,) async {
  51. // ignore: prefer_const_declarations
  52. final path = r'/jobs/{jobId}'
  53. .replaceAll('{jobId}', jobId.toString());
  54. // ignore: prefer_final_locals
  55. Object? postBody;
  56. final queryParams = <QueryParam>[];
  57. final headerParams = <String, String>{};
  58. final formParams = <String, String>{};
  59. const contentTypes = <String>[];
  60. return apiClient.invokeAPI(
  61. path,
  62. 'GET',
  63. queryParams,
  64. postBody,
  65. headerParams,
  66. formParams,
  67. contentTypes.isEmpty ? null : contentTypes.first,
  68. );
  69. }
  70. /// Parameters:
  71. ///
  72. /// * [JobId] jobId (required):
  73. Future<JobStatusResponseDto?> getJobStatus(JobId jobId,) async {
  74. final response = await getJobStatusWithHttpInfo(jobId,);
  75. if (response.statusCode >= HttpStatus.badRequest) {
  76. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  77. }
  78. // When a remote server returns no body with a status of 204, we shall not decode it.
  79. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  80. // FormatException when trying to decode an empty string.
  81. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  82. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'JobStatusResponseDto',) as JobStatusResponseDto;
  83. }
  84. return null;
  85. }
  86. /// Performs an HTTP 'PUT /jobs/{jobId}' operation and returns the [Response].
  87. /// Parameters:
  88. ///
  89. /// * [JobId] jobId (required):
  90. ///
  91. /// * [JobCommandDto] jobCommandDto (required):
  92. Future<Response> sendJobCommandWithHttpInfo(JobId jobId, JobCommandDto jobCommandDto,) async {
  93. // ignore: prefer_const_declarations
  94. final path = r'/jobs/{jobId}'
  95. .replaceAll('{jobId}', jobId.toString());
  96. // ignore: prefer_final_locals
  97. Object? postBody = jobCommandDto;
  98. final queryParams = <QueryParam>[];
  99. final headerParams = <String, String>{};
  100. final formParams = <String, String>{};
  101. const contentTypes = <String>['application/json'];
  102. return apiClient.invokeAPI(
  103. path,
  104. 'PUT',
  105. queryParams,
  106. postBody,
  107. headerParams,
  108. formParams,
  109. contentTypes.isEmpty ? null : contentTypes.first,
  110. );
  111. }
  112. /// Parameters:
  113. ///
  114. /// * [JobId] jobId (required):
  115. ///
  116. /// * [JobCommandDto] jobCommandDto (required):
  117. Future<num?> sendJobCommand(JobId jobId, JobCommandDto jobCommandDto,) async {
  118. final response = await sendJobCommandWithHttpInfo(jobId, jobCommandDto,);
  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), 'num',) as num;
  127. }
  128. return null;
  129. }
  130. }