device_info_api.dart 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 DeviceInfoApi {
  11. DeviceInfoApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// @deprecated
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. ///
  17. /// Parameters:
  18. ///
  19. /// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
  20. Future<Response> createDeviceInfoWithHttpInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
  21. // ignore: prefer_const_declarations
  22. final path = r'/device-info';
  23. // ignore: prefer_final_locals
  24. Object? postBody = upsertDeviceInfoDto;
  25. final queryParams = <QueryParam>[];
  26. final headerParams = <String, String>{};
  27. final formParams = <String, String>{};
  28. const contentTypes = <String>['application/json'];
  29. return apiClient.invokeAPI(
  30. path,
  31. 'POST',
  32. queryParams,
  33. postBody,
  34. headerParams,
  35. formParams,
  36. contentTypes.isEmpty ? null : contentTypes.first,
  37. );
  38. }
  39. /// @deprecated
  40. ///
  41. /// Parameters:
  42. ///
  43. /// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
  44. Future<DeviceInfoResponseDto?> createDeviceInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
  45. final response = await createDeviceInfoWithHttpInfo(upsertDeviceInfoDto,);
  46. if (response.statusCode >= HttpStatus.badRequest) {
  47. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  48. }
  49. // When a remote server returns no body with a status of 204, we shall not decode it.
  50. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  51. // FormatException when trying to decode an empty string.
  52. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  53. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceInfoResponseDto',) as DeviceInfoResponseDto;
  54. }
  55. return null;
  56. }
  57. /// @deprecated
  58. ///
  59. /// Note: This method returns the HTTP [Response].
  60. ///
  61. /// Parameters:
  62. ///
  63. /// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
  64. Future<Response> updateDeviceInfoWithHttpInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
  65. // ignore: prefer_const_declarations
  66. final path = r'/device-info';
  67. // ignore: prefer_final_locals
  68. Object? postBody = upsertDeviceInfoDto;
  69. final queryParams = <QueryParam>[];
  70. final headerParams = <String, String>{};
  71. final formParams = <String, String>{};
  72. const contentTypes = <String>['application/json'];
  73. return apiClient.invokeAPI(
  74. path,
  75. 'PATCH',
  76. queryParams,
  77. postBody,
  78. headerParams,
  79. formParams,
  80. contentTypes.isEmpty ? null : contentTypes.first,
  81. );
  82. }
  83. /// @deprecated
  84. ///
  85. /// Parameters:
  86. ///
  87. /// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
  88. Future<DeviceInfoResponseDto?> updateDeviceInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
  89. final response = await updateDeviceInfoWithHttpInfo(upsertDeviceInfoDto,);
  90. if (response.statusCode >= HttpStatus.badRequest) {
  91. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  92. }
  93. // When a remote server returns no body with a status of 204, we shall not decode it.
  94. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  95. // FormatException when trying to decode an empty string.
  96. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  97. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceInfoResponseDto',) as DeviceInfoResponseDto;
  98. }
  99. return null;
  100. }
  101. /// Performs an HTTP 'PUT /device-info' operation and returns the [Response].
  102. /// Parameters:
  103. ///
  104. /// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
  105. Future<Response> upsertDeviceInfoWithHttpInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
  106. // ignore: prefer_const_declarations
  107. final path = r'/device-info';
  108. // ignore: prefer_final_locals
  109. Object? postBody = upsertDeviceInfoDto;
  110. final queryParams = <QueryParam>[];
  111. final headerParams = <String, String>{};
  112. final formParams = <String, String>{};
  113. const contentTypes = <String>['application/json'];
  114. return apiClient.invokeAPI(
  115. path,
  116. 'PUT',
  117. queryParams,
  118. postBody,
  119. headerParams,
  120. formParams,
  121. contentTypes.isEmpty ? null : contentTypes.first,
  122. );
  123. }
  124. /// Parameters:
  125. ///
  126. /// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
  127. Future<DeviceInfoResponseDto?> upsertDeviceInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
  128. final response = await upsertDeviceInfoWithHttpInfo(upsertDeviceInfoDto,);
  129. if (response.statusCode >= HttpStatus.badRequest) {
  130. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  131. }
  132. // When a remote server returns no body with a status of 204, we shall not decode it.
  133. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  134. // FormatException when trying to decode an empty string.
  135. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  136. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceInfoResponseDto',) as DeviceInfoResponseDto;
  137. }
  138. return null;
  139. }
  140. }