device_info_api.dart 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. ///
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. ///
  17. /// Parameters:
  18. ///
  19. /// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
  20. Future<Response> upsertDeviceInfoWithHttpInfo(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. 'PUT',
  32. queryParams,
  33. postBody,
  34. headerParams,
  35. formParams,
  36. contentTypes.isEmpty ? null : contentTypes.first,
  37. );
  38. }
  39. ///
  40. ///
  41. /// Parameters:
  42. ///
  43. /// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
  44. Future<DeviceInfoResponseDto?> upsertDeviceInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
  45. final response = await upsertDeviceInfoWithHttpInfo(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. }