job_api.dart 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. ///
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. Future<Response> getAllJobsStatusWithHttpInfo() async {
  17. // ignore: prefer_const_declarations
  18. final path = r'/jobs';
  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<AllJobStatusResponseDto?> getAllJobsStatus() async {
  37. final response = await getAllJobsStatusWithHttpInfo();
  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), 'AllJobStatusResponseDto',) as AllJobStatusResponseDto;
  46. }
  47. return null;
  48. }
  49. ///
  50. ///
  51. /// Note: This method returns the HTTP [Response].
  52. ///
  53. /// Parameters:
  54. ///
  55. /// * [JobName] jobId (required):
  56. ///
  57. /// * [JobCommandDto] jobCommandDto (required):
  58. Future<Response> sendJobCommandWithHttpInfo(JobName jobId, JobCommandDto jobCommandDto,) async {
  59. // ignore: prefer_const_declarations
  60. final path = r'/jobs/{jobId}'
  61. .replaceAll('{jobId}', jobId.toString());
  62. // ignore: prefer_final_locals
  63. Object? postBody = jobCommandDto;
  64. final queryParams = <QueryParam>[];
  65. final headerParams = <String, String>{};
  66. final formParams = <String, String>{};
  67. const contentTypes = <String>['application/json'];
  68. return apiClient.invokeAPI(
  69. path,
  70. 'PUT',
  71. queryParams,
  72. postBody,
  73. headerParams,
  74. formParams,
  75. contentTypes.isEmpty ? null : contentTypes.first,
  76. );
  77. }
  78. ///
  79. ///
  80. /// Parameters:
  81. ///
  82. /// * [JobName] jobId (required):
  83. ///
  84. /// * [JobCommandDto] jobCommandDto (required):
  85. Future<void> sendJobCommand(JobName jobId, JobCommandDto jobCommandDto,) async {
  86. final response = await sendJobCommandWithHttpInfo(jobId, jobCommandDto,);
  87. if (response.statusCode >= HttpStatus.badRequest) {
  88. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  89. }
  90. }
  91. }