weheat 2024.11.1__py3-none-any.whl → 2025.11.24rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. weheat/__init__.py +6 -2
  2. weheat/abstractions/__init__.py +1 -1
  3. weheat/abstractions/discovery.py +11 -7
  4. weheat/abstractions/heat_pump.py +223 -81
  5. weheat/abstractions/user.py +16 -11
  6. weheat/api/__init__.py +1 -0
  7. weheat/api/energy_log_api.py +615 -127
  8. weheat/api/heat_pump_api.py +580 -374
  9. weheat/api/heat_pump_log_api.py +884 -360
  10. weheat/api/user_api.py +260 -115
  11. weheat/api_client.py +238 -265
  12. weheat/api_response.py +11 -15
  13. weheat/configuration.py +14 -9
  14. weheat/exceptions.py +59 -25
  15. weheat/models/__init__.py +8 -0
  16. weheat/models/boiler_type.py +8 -3
  17. weheat/models/device_state.py +9 -5
  18. weheat/models/dhw_type.py +8 -3
  19. weheat/models/energy_view_dto.py +87 -65
  20. weheat/models/heat_pump_log_view_dto.py +1394 -559
  21. weheat/models/heat_pump_model.py +8 -3
  22. weheat/models/heat_pump_status_enum.py +9 -4
  23. weheat/models/pagination_metadata.py +95 -0
  24. weheat/models/raw_heat_pump_log_dto.py +438 -375
  25. weheat/models/raw_heatpump_log_and_is_online_dto.py +578 -0
  26. weheat/models/read_all_heat_pump_dto.py +69 -53
  27. weheat/models/read_all_heat_pump_dto_paged_response.py +107 -0
  28. weheat/models/read_heat_pump_dto.py +64 -48
  29. weheat/models/read_user_dto.py +55 -37
  30. weheat/models/read_user_me_dto.py +124 -0
  31. weheat/models/role.py +10 -4
  32. weheat/models/total_energy_aggregate.py +111 -0
  33. weheat/rest.py +152 -259
  34. weheat-2025.11.24rc1.dist-info/METADATA +104 -0
  35. weheat-2025.11.24rc1.dist-info/RECORD +39 -0
  36. {weheat-2024.11.1.dist-info → weheat-2025.11.24rc1.dist-info}/WHEEL +1 -1
  37. weheat/abstractions/auth.py +0 -34
  38. weheat/models/heat_pump_type.py +0 -42
  39. weheat-2024.11.1.dist-info/METADATA +0 -107
  40. weheat-2024.11.1.dist-info/RECORD +0 -36
  41. {weheat-2024.11.1.dist-info → weheat-2025.11.24rc1.dist-info/licenses}/LICENSE +0 -0
  42. {weheat-2024.11.1.dist-info → weheat-2025.11.24rc1.dist-info}/top_level.txt +0 -0
@@ -12,28 +12,32 @@
12
12
  """ # noqa: E501
13
13
 
14
14
 
15
- import re # noqa: F401
16
15
  import io
17
16
  import warnings
18
17
 
19
- from pydantic import validate_arguments, ValidationError
18
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
19
+ from typing import Dict, List, Optional, Tuple, Union, Any
20
20
 
21
+ try:
22
+ from typing import Annotated
23
+ except ImportError:
24
+ from typing_extensions import Annotated
25
+
26
+ from pydantic import Field
21
27
  from typing_extensions import Annotated
22
28
  from datetime import datetime
23
29
 
24
- from pydantic import Field, StrictStr
30
+ from pydantic import StrictStr
25
31
 
26
32
  from typing import List, Optional
27
33
 
28
34
  from weheat.models.heat_pump_log_view_dto import HeatPumpLogViewDto
29
35
  from weheat.models.raw_heat_pump_log_dto import RawHeatPumpLogDto
36
+ from weheat.models.raw_heatpump_log_and_is_online_dto import RawHeatpumpLogAndIsOnlineDto
30
37
 
31
38
  from weheat.api_client import ApiClient
32
39
  from weheat.api_response import ApiResponse
33
- from weheat.exceptions import ( # noqa: F401
34
- ApiTypeError,
35
- ApiValueError
36
- )
40
+ from weheat.rest import RESTResponseType
37
41
 
38
42
 
39
43
  class HeatPumpLogApi:
@@ -48,15 +52,31 @@ class HeatPumpLogApi:
48
52
  api_client = ApiClient.get_default()
49
53
  self.api_client = api_client
50
54
 
51
- @validate_arguments
52
- def api_v1_heat_pumps_heat_pump_id_logs_get(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The id of the heat pump")], start_time : Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, end_time : Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, interval : Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Minute\", \"FiveMinute\", \"FifteenMinute\", \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None, x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> List[HeatPumpLogViewDto]: # noqa: E501
53
- """Gets the heat pump logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Minute, FiveMinute, FifteenMinute, Hour, Day, Week, Month, Year Limits for these intervals are: 2 days, 1 week, 1 month, 1 month, 1 year, 2 years, 5 years, 100 years # noqa: E501
54
55
 
55
- This method makes a synchronous HTTP request by default. To make an
56
- asynchronous HTTP request, please pass async_req=True
56
+ @validate_call
57
+ async def api_v1_heat_pumps_heat_pump_id_logs_get(
58
+ self,
59
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
60
+ start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
61
+ end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
62
+ interval: Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Minute\", \"FiveMinute\", \"FifteenMinute\", \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None,
63
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
64
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
65
+ _request_timeout: Union[
66
+ None,
67
+ Annotated[StrictFloat, Field(gt=0)],
68
+ Tuple[
69
+ Annotated[StrictFloat, Field(gt=0)],
70
+ Annotated[StrictFloat, Field(gt=0)]
71
+ ]
72
+ ] = None,
73
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
74
+ _content_type: Optional[StrictStr] = None,
75
+ _headers: Optional[Dict[StrictStr, Any]] = None,
76
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
77
+ ) -> List[HeatPumpLogViewDto]:
78
+ """Gets the heat pump logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Minute, FiveMinute, FifteenMinute, Hour, Day, Week, Month, Year Limits for these intervals are: 2 days, 1 week, 1 month, 1 month, 1 year, 2 years, 5 years, 100 years Totals max logs per interval: 2880 2016 2688 672, 365, 104, 60, 100
57
79
 
58
- >>> thread = api.api_v1_heat_pumps_heat_pump_id_logs_get(heat_pump_id, start_time, end_time, interval, x_version, async_req=True)
59
- >>> result = thread.get()
60
80
 
61
81
  :param heat_pump_id: The id of the heat pump (required)
62
82
  :type heat_pump_id: str
@@ -68,32 +88,86 @@ class HeatPumpLogApi:
68
88
  :type interval: str
69
89
  :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
70
90
  :type x_version: str
71
- :param async_req: Whether to execute the request asynchronously.
72
- :type async_req: bool, optional
73
- :param _request_timeout: timeout setting for this request.
74
- If one number provided, it will be total request
75
- timeout. It can also be a pair (tuple) of
76
- (connection, read) timeouts.
91
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
92
+ :type x_backend_version: str
93
+ :param _request_timeout: timeout setting for this request. If one
94
+ number provided, it will be total request
95
+ timeout. It can also be a pair (tuple) of
96
+ (connection, read) timeouts.
97
+ :type _request_timeout: int, tuple(int, int), optional
98
+ :param _request_auth: set to override the auth_settings for an a single
99
+ request; this effectively ignores the
100
+ authentication in the spec for a single request.
101
+ :type _request_auth: dict, optional
102
+ :param _content_type: force content-type for the request.
103
+ :type _content_type: str, Optional
104
+ :param _headers: set to override the headers for a single
105
+ request; this effectively ignores the headers
106
+ in the spec for a single request.
107
+ :type _headers: dict, optional
108
+ :param _host_index: set to override the host_index for a single
109
+ request; this effectively ignores the host_index
110
+ in the spec for a single request.
111
+ :type _host_index: int, optional
77
112
  :return: Returns the result object.
78
- If the method is called asynchronously,
79
- returns the request thread.
80
- :rtype: List[HeatPumpLogViewDto]
81
- """
82
- kwargs['_return_http_data_only'] = True
83
- if '_preload_content' in kwargs:
84
- message = "Error! Please call the api_v1_heat_pumps_heat_pump_id_logs_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
85
- raise ValueError(message)
86
- return self.api_v1_heat_pumps_heat_pump_id_logs_get_with_http_info(heat_pump_id, start_time, end_time, interval, x_version, **kwargs) # noqa: E501
87
-
88
- @validate_arguments
89
- def api_v1_heat_pumps_heat_pump_id_logs_get_with_http_info(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The id of the heat pump")], start_time : Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, end_time : Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, interval : Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Minute\", \"FiveMinute\", \"FifteenMinute\", \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None, x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> ApiResponse: # noqa: E501
90
- """Gets the heat pump logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Minute, FiveMinute, FifteenMinute, Hour, Day, Week, Month, Year Limits for these intervals are: 2 days, 1 week, 1 month, 1 month, 1 year, 2 years, 5 years, 100 years # noqa: E501
91
-
92
- This method makes a synchronous HTTP request by default. To make an
93
- asynchronous HTTP request, please pass async_req=True
94
-
95
- >>> thread = api.api_v1_heat_pumps_heat_pump_id_logs_get_with_http_info(heat_pump_id, start_time, end_time, interval, x_version, async_req=True)
96
- >>> result = thread.get()
113
+ """ # noqa: E501
114
+
115
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_get_serialize(
116
+ heat_pump_id=heat_pump_id,
117
+ start_time=start_time,
118
+ end_time=end_time,
119
+ interval=interval,
120
+ x_version=x_version,
121
+ x_backend_version=x_backend_version,
122
+ _request_auth=_request_auth,
123
+ _content_type=_content_type,
124
+ _headers=_headers,
125
+ _host_index=_host_index
126
+ )
127
+
128
+ _response_types_map: Dict[str, Optional[str]] = {
129
+ '403': "str",
130
+ '500': None,
131
+ '505': None,
132
+ '200': "List[HeatPumpLogViewDto]",
133
+ '400': None,
134
+ '404': None,
135
+ }
136
+ response_data = await self.api_client.call_api(
137
+ *_param,
138
+ _request_timeout=_request_timeout
139
+ )
140
+ await response_data.read()
141
+ return self.api_client.response_deserialize(
142
+ response_data=response_data,
143
+ response_types_map=_response_types_map,
144
+ ).data
145
+
146
+
147
+ @validate_call
148
+ async def api_v1_heat_pumps_heat_pump_id_logs_get_with_http_info(
149
+ self,
150
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
151
+ start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
152
+ end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
153
+ interval: Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Minute\", \"FiveMinute\", \"FifteenMinute\", \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None,
154
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
155
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
156
+ _request_timeout: Union[
157
+ None,
158
+ Annotated[StrictFloat, Field(gt=0)],
159
+ Tuple[
160
+ Annotated[StrictFloat, Field(gt=0)],
161
+ Annotated[StrictFloat, Field(gt=0)]
162
+ ]
163
+ ] = None,
164
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
165
+ _content_type: Optional[StrictStr] = None,
166
+ _headers: Optional[Dict[StrictStr, Any]] = None,
167
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
168
+ ) -> ApiResponse[List[HeatPumpLogViewDto]]:
169
+ """Gets the heat pump logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Minute, FiveMinute, FifteenMinute, Hour, Day, Week, Month, Year Limits for these intervals are: 2 days, 1 week, 1 month, 1 month, 1 year, 2 years, 5 years, 100 years Totals max logs per interval: 2880 2016 2688 672, 365, 104, 60, 100
170
+
97
171
 
98
172
  :param heat_pump_id: The id of the heat pump (required)
99
173
  :type heat_pump_id: str
@@ -105,289 +179,573 @@ class HeatPumpLogApi:
105
179
  :type interval: str
106
180
  :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
107
181
  :type x_version: str
108
- :param async_req: Whether to execute the request asynchronously.
109
- :type async_req: bool, optional
110
- :param _preload_content: if False, the ApiResponse.data will
111
- be set to none and raw_data will store the
112
- HTTP response body without reading/decoding.
113
- Default is True.
114
- :type _preload_content: bool, optional
115
- :param _return_http_data_only: response data instead of ApiResponse
116
- object with status code, headers, etc
117
- :type _return_http_data_only: bool, optional
182
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
183
+ :type x_backend_version: str
118
184
  :param _request_timeout: timeout setting for this request. If one
119
185
  number provided, it will be total request
120
186
  timeout. It can also be a pair (tuple) of
121
187
  (connection, read) timeouts.
188
+ :type _request_timeout: int, tuple(int, int), optional
122
189
  :param _request_auth: set to override the auth_settings for an a single
123
- request; this effectively ignores the authentication
124
- in the spec for a single request.
190
+ request; this effectively ignores the
191
+ authentication in the spec for a single request.
125
192
  :type _request_auth: dict, optional
126
- :type _content_type: string, optional: force content-type for the request
193
+ :param _content_type: force content-type for the request.
194
+ :type _content_type: str, Optional
195
+ :param _headers: set to override the headers for a single
196
+ request; this effectively ignores the headers
197
+ in the spec for a single request.
198
+ :type _headers: dict, optional
199
+ :param _host_index: set to override the host_index for a single
200
+ request; this effectively ignores the host_index
201
+ in the spec for a single request.
202
+ :type _host_index: int, optional
127
203
  :return: Returns the result object.
128
- If the method is called asynchronously,
129
- returns the request thread.
130
- :rtype: tuple(List[HeatPumpLogViewDto], status_code(int), headers(HTTPHeaderDict))
131
- """
132
-
133
- _params = locals()
134
-
135
- _all_params = [
136
- 'heat_pump_id',
137
- 'start_time',
138
- 'end_time',
139
- 'interval',
140
- 'x_version'
141
- ]
142
- _all_params.extend(
143
- [
144
- 'async_req',
145
- '_return_http_data_only',
146
- '_preload_content',
147
- '_request_timeout',
148
- '_request_auth',
149
- '_content_type',
150
- '_headers'
151
- ]
204
+ """ # noqa: E501
205
+
206
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_get_serialize(
207
+ heat_pump_id=heat_pump_id,
208
+ start_time=start_time,
209
+ end_time=end_time,
210
+ interval=interval,
211
+ x_version=x_version,
212
+ x_backend_version=x_backend_version,
213
+ _request_auth=_request_auth,
214
+ _content_type=_content_type,
215
+ _headers=_headers,
216
+ _host_index=_host_index
152
217
  )
153
218
 
154
- # validate the arguments
155
- for _key, _val in _params['kwargs'].items():
156
- if _key not in _all_params:
157
- raise ApiTypeError(
158
- "Got an unexpected keyword argument '%s'"
159
- " to method api_v1_heat_pumps_heat_pump_id_logs_get" % _key
160
- )
161
- _params[_key] = _val
162
- del _params['kwargs']
219
+ _response_types_map: Dict[str, Optional[str]] = {
220
+ '403': "str",
221
+ '500': None,
222
+ '505': None,
223
+ '200': "List[HeatPumpLogViewDto]",
224
+ '400': None,
225
+ '404': None,
226
+ }
227
+ response_data = await self.api_client.call_api(
228
+ *_param,
229
+ _request_timeout=_request_timeout
230
+ )
231
+ await response_data.read()
232
+ return self.api_client.response_deserialize(
233
+ response_data=response_data,
234
+ response_types_map=_response_types_map,
235
+ )
163
236
 
164
- _collection_formats = {}
165
237
 
166
- # process the path parameters
167
- _path_params = {}
168
- if _params['heat_pump_id'] is not None:
169
- _path_params['heatPumpId'] = _params['heat_pump_id']
238
+ @validate_call
239
+ async def api_v1_heat_pumps_heat_pump_id_logs_get_without_preload_content(
240
+ self,
241
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
242
+ start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
243
+ end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
244
+ interval: Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Minute\", \"FiveMinute\", \"FifteenMinute\", \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None,
245
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
246
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
247
+ _request_timeout: Union[
248
+ None,
249
+ Annotated[StrictFloat, Field(gt=0)],
250
+ Tuple[
251
+ Annotated[StrictFloat, Field(gt=0)],
252
+ Annotated[StrictFloat, Field(gt=0)]
253
+ ]
254
+ ] = None,
255
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
256
+ _content_type: Optional[StrictStr] = None,
257
+ _headers: Optional[Dict[StrictStr, Any]] = None,
258
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
259
+ ) -> RESTResponseType:
260
+ """Gets the heat pump logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Minute, FiveMinute, FifteenMinute, Hour, Day, Week, Month, Year Limits for these intervals are: 2 days, 1 week, 1 month, 1 month, 1 year, 2 years, 5 years, 100 years Totals max logs per interval: 2880 2016 2688 672, 365, 104, 60, 100
170
261
 
171
262
 
172
- # process the query parameters
173
- _query_params = []
174
- if _params.get('start_time') is not None: # noqa: E501
175
- if isinstance(_params['start_time'], datetime):
176
- _query_params.append(('startTime', _params['start_time'].strftime(self.api_client.configuration.datetime_format)))
177
- else:
178
- _query_params.append(('startTime', _params['start_time']))
263
+ :param heat_pump_id: The id of the heat pump (required)
264
+ :type heat_pump_id: str
265
+ :param start_time: Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)
266
+ :type start_time: datetime
267
+ :param end_time: End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)
268
+ :type end_time: datetime
269
+ :param interval: Interval granularity of the log data, allowed intervals: \"Minute\", \"FiveMinute\", \"FifteenMinute\", \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"
270
+ :type interval: str
271
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
272
+ :type x_version: str
273
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
274
+ :type x_backend_version: str
275
+ :param _request_timeout: timeout setting for this request. If one
276
+ number provided, it will be total request
277
+ timeout. It can also be a pair (tuple) of
278
+ (connection, read) timeouts.
279
+ :type _request_timeout: int, tuple(int, int), optional
280
+ :param _request_auth: set to override the auth_settings for an a single
281
+ request; this effectively ignores the
282
+ authentication in the spec for a single request.
283
+ :type _request_auth: dict, optional
284
+ :param _content_type: force content-type for the request.
285
+ :type _content_type: str, Optional
286
+ :param _headers: set to override the headers for a single
287
+ request; this effectively ignores the headers
288
+ in the spec for a single request.
289
+ :type _headers: dict, optional
290
+ :param _host_index: set to override the host_index for a single
291
+ request; this effectively ignores the host_index
292
+ in the spec for a single request.
293
+ :type _host_index: int, optional
294
+ :return: Returns the result object.
295
+ """ # noqa: E501
296
+
297
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_get_serialize(
298
+ heat_pump_id=heat_pump_id,
299
+ start_time=start_time,
300
+ end_time=end_time,
301
+ interval=interval,
302
+ x_version=x_version,
303
+ x_backend_version=x_backend_version,
304
+ _request_auth=_request_auth,
305
+ _content_type=_content_type,
306
+ _headers=_headers,
307
+ _host_index=_host_index
308
+ )
179
309
 
180
- if _params.get('end_time') is not None: # noqa: E501
181
- if isinstance(_params['end_time'], datetime):
182
- _query_params.append(('endTime', _params['end_time'].strftime(self.api_client.configuration.datetime_format)))
183
- else:
184
- _query_params.append(('endTime', _params['end_time']))
310
+ _response_types_map: Dict[str, Optional[str]] = {
311
+ '403': "str",
312
+ '500': None,
313
+ '505': None,
314
+ '200': "List[HeatPumpLogViewDto]",
315
+ '400': None,
316
+ '404': None,
317
+ }
318
+ response_data = await self.api_client.call_api(
319
+ *_param,
320
+ _request_timeout=_request_timeout
321
+ )
322
+ return response_data.response
323
+
324
+
325
+ def _api_v1_heat_pumps_heat_pump_id_logs_get_serialize(
326
+ self,
327
+ heat_pump_id,
328
+ start_time,
329
+ end_time,
330
+ interval,
331
+ x_version,
332
+ x_backend_version,
333
+ _request_auth,
334
+ _content_type,
335
+ _headers,
336
+ _host_index,
337
+ ) -> Tuple:
338
+
339
+ _host = None
340
+
341
+ _collection_formats: Dict[str, str] = {
342
+ }
185
343
 
186
- if _params.get('interval') is not None: # noqa: E501
187
- _query_params.append(('interval', _params['interval']))
344
+ _path_params: Dict[str, str] = {}
345
+ _query_params: List[Tuple[str, str]] = []
346
+ _header_params: Dict[str, Optional[str]] = _headers or {}
347
+ _form_params: List[Tuple[str, str]] = []
348
+ _files: Dict[str, str] = {}
349
+ _body_params: Optional[bytes] = None
188
350
 
351
+ # process the path parameters
352
+ if heat_pump_id is not None:
353
+ _path_params['heatPumpId'] = heat_pump_id
354
+ # process the query parameters
355
+ if start_time is not None:
356
+ if isinstance(start_time, datetime):
357
+ _query_params.append(
358
+ (
359
+ 'startTime',
360
+ start_time.strftime(
361
+ self.api_client.configuration.datetime_format
362
+ )
363
+ )
364
+ )
365
+ else:
366
+ _query_params.append(('startTime', start_time))
367
+
368
+ if end_time is not None:
369
+ if isinstance(end_time, datetime):
370
+ _query_params.append(
371
+ (
372
+ 'endTime',
373
+ end_time.strftime(
374
+ self.api_client.configuration.datetime_format
375
+ )
376
+ )
377
+ )
378
+ else:
379
+ _query_params.append(('endTime', end_time))
380
+
381
+ if interval is not None:
382
+
383
+ _query_params.append(('interval', interval))
384
+
189
385
  # process the header parameters
190
- _header_params = dict(_params.get('_headers', {}))
191
- if _params['x_version'] is not None:
192
- _header_params['x-version'] = _params['x_version']
193
-
386
+ if x_version is not None:
387
+ _header_params['x-version'] = x_version
388
+ if x_backend_version is not None:
389
+ _header_params['x-backend-version'] = x_backend_version
194
390
  # process the form parameters
195
- _form_params = []
196
- _files = {}
197
391
  # process the body parameter
198
- _body_params = None
392
+
393
+
199
394
  # set the HTTP header `Accept`
200
395
  _header_params['Accept'] = self.api_client.select_header_accept(
201
- ['text/plain', 'application/json', 'text/json']) # noqa: E501
396
+ [
397
+ 'text/plain',
398
+ 'application/json',
399
+ 'text/json'
400
+ ]
401
+ )
202
402
 
203
- # authentication setting
204
- _auth_settings = ['oauth2'] # noqa: E501
205
403
 
206
- _response_types_map = {
207
- '403': "str",
208
- '505': None,
209
- '200': "List[HeatPumpLogViewDto]",
210
- '400': None,
211
- '404': None,
212
- '500': None,
213
- }
404
+ # authentication setting
405
+ _auth_settings: List[str] = [
406
+ 'oauth2'
407
+ ]
214
408
 
215
- return self.api_client.call_api(
216
- '/api/v1/heat-pumps/{heatPumpId}/logs', 'GET',
217
- _path_params,
218
- _query_params,
219
- _header_params,
409
+ return self.api_client.param_serialize(
410
+ method='GET',
411
+ resource_path='/api/v1/heat-pumps/{heatPumpId}/logs',
412
+ path_params=_path_params,
413
+ query_params=_query_params,
414
+ header_params=_header_params,
220
415
  body=_body_params,
221
416
  post_params=_form_params,
222
417
  files=_files,
223
- response_types_map=_response_types_map,
224
418
  auth_settings=_auth_settings,
225
- async_req=_params.get('async_req'),
226
- _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
227
- _preload_content=_params.get('_preload_content', True),
228
- _request_timeout=_params.get('_request_timeout'),
229
419
  collection_formats=_collection_formats,
230
- _request_auth=_params.get('_request_auth'))
420
+ _host=_host,
421
+ _request_auth=_request_auth
422
+ )
423
+
424
+
231
425
 
232
- @validate_arguments
233
- def api_v1_heat_pumps_heat_pump_id_logs_latest_get(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The id of the heat pump")], x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> RawHeatPumpLogDto: # noqa: E501
234
- """Gets the latest raw heat pump log of the heat pump # noqa: E501
235
426
 
236
- This method makes a synchronous HTTP request by default. To make an
237
- asynchronous HTTP request, please pass async_req=True
427
+ @validate_call
428
+ async def api_v1_heat_pumps_heat_pump_id_logs_latest_get(
429
+ self,
430
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
431
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
432
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
433
+ _request_timeout: Union[
434
+ None,
435
+ Annotated[StrictFloat, Field(gt=0)],
436
+ Tuple[
437
+ Annotated[StrictFloat, Field(gt=0)],
438
+ Annotated[StrictFloat, Field(gt=0)]
439
+ ]
440
+ ] = None,
441
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
442
+ _content_type: Optional[StrictStr] = None,
443
+ _headers: Optional[Dict[StrictStr, Any]] = None,
444
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
445
+ ) -> RawHeatpumpLogAndIsOnlineDto:
446
+ """Gets the latest raw heat pump log of the heat pump and a boolean indicating whether the heat pump is online.
238
447
 
239
- >>> thread = api.api_v1_heat_pumps_heat_pump_id_logs_latest_get(heat_pump_id, x_version, async_req=True)
240
- >>> result = thread.get()
241
448
 
242
449
  :param heat_pump_id: The id of the heat pump (required)
243
450
  :type heat_pump_id: str
244
451
  :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
245
452
  :type x_version: str
246
- :param async_req: Whether to execute the request asynchronously.
247
- :type async_req: bool, optional
248
- :param _request_timeout: timeout setting for this request.
249
- If one number provided, it will be total request
250
- timeout. It can also be a pair (tuple) of
251
- (connection, read) timeouts.
453
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
454
+ :type x_backend_version: str
455
+ :param _request_timeout: timeout setting for this request. If one
456
+ number provided, it will be total request
457
+ timeout. It can also be a pair (tuple) of
458
+ (connection, read) timeouts.
459
+ :type _request_timeout: int, tuple(int, int), optional
460
+ :param _request_auth: set to override the auth_settings for an a single
461
+ request; this effectively ignores the
462
+ authentication in the spec for a single request.
463
+ :type _request_auth: dict, optional
464
+ :param _content_type: force content-type for the request.
465
+ :type _content_type: str, Optional
466
+ :param _headers: set to override the headers for a single
467
+ request; this effectively ignores the headers
468
+ in the spec for a single request.
469
+ :type _headers: dict, optional
470
+ :param _host_index: set to override the host_index for a single
471
+ request; this effectively ignores the host_index
472
+ in the spec for a single request.
473
+ :type _host_index: int, optional
252
474
  :return: Returns the result object.
253
- If the method is called asynchronously,
254
- returns the request thread.
255
- :rtype: RawHeatPumpLogDto
256
- """
257
- kwargs['_return_http_data_only'] = True
258
- if '_preload_content' in kwargs:
259
- message = "Error! Please call the api_v1_heat_pumps_heat_pump_id_logs_latest_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
260
- raise ValueError(message)
261
- return self.api_v1_heat_pumps_heat_pump_id_logs_latest_get_with_http_info(heat_pump_id, x_version, **kwargs) # noqa: E501
262
-
263
- @validate_arguments
264
- def api_v1_heat_pumps_heat_pump_id_logs_latest_get_with_http_info(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The id of the heat pump")], x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> ApiResponse: # noqa: E501
265
- """Gets the latest raw heat pump log of the heat pump # noqa: E501
266
-
267
- This method makes a synchronous HTTP request by default. To make an
268
- asynchronous HTTP request, please pass async_req=True
269
-
270
- >>> thread = api.api_v1_heat_pumps_heat_pump_id_logs_latest_get_with_http_info(heat_pump_id, x_version, async_req=True)
271
- >>> result = thread.get()
475
+ """ # noqa: E501
476
+
477
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_latest_get_serialize(
478
+ heat_pump_id=heat_pump_id,
479
+ x_version=x_version,
480
+ x_backend_version=x_backend_version,
481
+ _request_auth=_request_auth,
482
+ _content_type=_content_type,
483
+ _headers=_headers,
484
+ _host_index=_host_index
485
+ )
486
+
487
+ _response_types_map: Dict[str, Optional[str]] = {
488
+ '403': "str",
489
+ '500': None,
490
+ '505': None,
491
+ '200': "RawHeatpumpLogAndIsOnlineDto",
492
+ '404': None,
493
+ }
494
+ response_data = await self.api_client.call_api(
495
+ *_param,
496
+ _request_timeout=_request_timeout
497
+ )
498
+ await response_data.read()
499
+ return self.api_client.response_deserialize(
500
+ response_data=response_data,
501
+ response_types_map=_response_types_map,
502
+ ).data
503
+
504
+
505
+ @validate_call
506
+ async def api_v1_heat_pumps_heat_pump_id_logs_latest_get_with_http_info(
507
+ self,
508
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
509
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
510
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
511
+ _request_timeout: Union[
512
+ None,
513
+ Annotated[StrictFloat, Field(gt=0)],
514
+ Tuple[
515
+ Annotated[StrictFloat, Field(gt=0)],
516
+ Annotated[StrictFloat, Field(gt=0)]
517
+ ]
518
+ ] = None,
519
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
520
+ _content_type: Optional[StrictStr] = None,
521
+ _headers: Optional[Dict[StrictStr, Any]] = None,
522
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
523
+ ) -> ApiResponse[RawHeatpumpLogAndIsOnlineDto]:
524
+ """Gets the latest raw heat pump log of the heat pump and a boolean indicating whether the heat pump is online.
525
+
272
526
 
273
527
  :param heat_pump_id: The id of the heat pump (required)
274
528
  :type heat_pump_id: str
275
529
  :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
276
530
  :type x_version: str
277
- :param async_req: Whether to execute the request asynchronously.
278
- :type async_req: bool, optional
279
- :param _preload_content: if False, the ApiResponse.data will
280
- be set to none and raw_data will store the
281
- HTTP response body without reading/decoding.
282
- Default is True.
283
- :type _preload_content: bool, optional
284
- :param _return_http_data_only: response data instead of ApiResponse
285
- object with status code, headers, etc
286
- :type _return_http_data_only: bool, optional
531
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
532
+ :type x_backend_version: str
287
533
  :param _request_timeout: timeout setting for this request. If one
288
534
  number provided, it will be total request
289
535
  timeout. It can also be a pair (tuple) of
290
536
  (connection, read) timeouts.
537
+ :type _request_timeout: int, tuple(int, int), optional
291
538
  :param _request_auth: set to override the auth_settings for an a single
292
- request; this effectively ignores the authentication
293
- in the spec for a single request.
539
+ request; this effectively ignores the
540
+ authentication in the spec for a single request.
294
541
  :type _request_auth: dict, optional
295
- :type _content_type: string, optional: force content-type for the request
542
+ :param _content_type: force content-type for the request.
543
+ :type _content_type: str, Optional
544
+ :param _headers: set to override the headers for a single
545
+ request; this effectively ignores the headers
546
+ in the spec for a single request.
547
+ :type _headers: dict, optional
548
+ :param _host_index: set to override the host_index for a single
549
+ request; this effectively ignores the host_index
550
+ in the spec for a single request.
551
+ :type _host_index: int, optional
296
552
  :return: Returns the result object.
297
- If the method is called asynchronously,
298
- returns the request thread.
299
- :rtype: tuple(RawHeatPumpLogDto, status_code(int), headers(HTTPHeaderDict))
300
- """
553
+ """ # noqa: E501
554
+
555
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_latest_get_serialize(
556
+ heat_pump_id=heat_pump_id,
557
+ x_version=x_version,
558
+ x_backend_version=x_backend_version,
559
+ _request_auth=_request_auth,
560
+ _content_type=_content_type,
561
+ _headers=_headers,
562
+ _host_index=_host_index
563
+ )
564
+
565
+ _response_types_map: Dict[str, Optional[str]] = {
566
+ '403': "str",
567
+ '500': None,
568
+ '505': None,
569
+ '200': "RawHeatpumpLogAndIsOnlineDto",
570
+ '404': None,
571
+ }
572
+ response_data = await self.api_client.call_api(
573
+ *_param,
574
+ _request_timeout=_request_timeout
575
+ )
576
+ await response_data.read()
577
+ return self.api_client.response_deserialize(
578
+ response_data=response_data,
579
+ response_types_map=_response_types_map,
580
+ )
301
581
 
302
- _params = locals()
303
582
 
304
- _all_params = [
305
- 'heat_pump_id',
306
- 'x_version'
307
- ]
308
- _all_params.extend(
309
- [
310
- 'async_req',
311
- '_return_http_data_only',
312
- '_preload_content',
313
- '_request_timeout',
314
- '_request_auth',
315
- '_content_type',
316
- '_headers'
583
+ @validate_call
584
+ async def api_v1_heat_pumps_heat_pump_id_logs_latest_get_without_preload_content(
585
+ self,
586
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
587
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
588
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
589
+ _request_timeout: Union[
590
+ None,
591
+ Annotated[StrictFloat, Field(gt=0)],
592
+ Tuple[
593
+ Annotated[StrictFloat, Field(gt=0)],
594
+ Annotated[StrictFloat, Field(gt=0)]
317
595
  ]
596
+ ] = None,
597
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
598
+ _content_type: Optional[StrictStr] = None,
599
+ _headers: Optional[Dict[StrictStr, Any]] = None,
600
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
601
+ ) -> RESTResponseType:
602
+ """Gets the latest raw heat pump log of the heat pump and a boolean indicating whether the heat pump is online.
603
+
604
+
605
+ :param heat_pump_id: The id of the heat pump (required)
606
+ :type heat_pump_id: str
607
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
608
+ :type x_version: str
609
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
610
+ :type x_backend_version: str
611
+ :param _request_timeout: timeout setting for this request. If one
612
+ number provided, it will be total request
613
+ timeout. It can also be a pair (tuple) of
614
+ (connection, read) timeouts.
615
+ :type _request_timeout: int, tuple(int, int), optional
616
+ :param _request_auth: set to override the auth_settings for an a single
617
+ request; this effectively ignores the
618
+ authentication in the spec for a single request.
619
+ :type _request_auth: dict, optional
620
+ :param _content_type: force content-type for the request.
621
+ :type _content_type: str, Optional
622
+ :param _headers: set to override the headers for a single
623
+ request; this effectively ignores the headers
624
+ in the spec for a single request.
625
+ :type _headers: dict, optional
626
+ :param _host_index: set to override the host_index for a single
627
+ request; this effectively ignores the host_index
628
+ in the spec for a single request.
629
+ :type _host_index: int, optional
630
+ :return: Returns the result object.
631
+ """ # noqa: E501
632
+
633
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_latest_get_serialize(
634
+ heat_pump_id=heat_pump_id,
635
+ x_version=x_version,
636
+ x_backend_version=x_backend_version,
637
+ _request_auth=_request_auth,
638
+ _content_type=_content_type,
639
+ _headers=_headers,
640
+ _host_index=_host_index
318
641
  )
319
642
 
320
- # validate the arguments
321
- for _key, _val in _params['kwargs'].items():
322
- if _key not in _all_params:
323
- raise ApiTypeError(
324
- "Got an unexpected keyword argument '%s'"
325
- " to method api_v1_heat_pumps_heat_pump_id_logs_latest_get" % _key
326
- )
327
- _params[_key] = _val
328
- del _params['kwargs']
643
+ _response_types_map: Dict[str, Optional[str]] = {
644
+ '403': "str",
645
+ '500': None,
646
+ '505': None,
647
+ '200': "RawHeatpumpLogAndIsOnlineDto",
648
+ '404': None,
649
+ }
650
+ response_data = await self.api_client.call_api(
651
+ *_param,
652
+ _request_timeout=_request_timeout
653
+ )
654
+ return response_data.response
329
655
 
330
- _collection_formats = {}
331
656
 
332
- # process the path parameters
333
- _path_params = {}
334
- if _params['heat_pump_id'] is not None:
335
- _path_params['heatPumpId'] = _params['heat_pump_id']
657
+ def _api_v1_heat_pumps_heat_pump_id_logs_latest_get_serialize(
658
+ self,
659
+ heat_pump_id,
660
+ x_version,
661
+ x_backend_version,
662
+ _request_auth,
663
+ _content_type,
664
+ _headers,
665
+ _host_index,
666
+ ) -> Tuple:
667
+
668
+ _host = None
336
669
 
670
+ _collection_formats: Dict[str, str] = {
671
+ }
672
+
673
+ _path_params: Dict[str, str] = {}
674
+ _query_params: List[Tuple[str, str]] = []
675
+ _header_params: Dict[str, Optional[str]] = _headers or {}
676
+ _form_params: List[Tuple[str, str]] = []
677
+ _files: Dict[str, str] = {}
678
+ _body_params: Optional[bytes] = None
337
679
 
680
+ # process the path parameters
681
+ if heat_pump_id is not None:
682
+ _path_params['heatPumpId'] = heat_pump_id
338
683
  # process the query parameters
339
- _query_params = []
340
684
  # process the header parameters
341
- _header_params = dict(_params.get('_headers', {}))
342
- if _params['x_version'] is not None:
343
- _header_params['x-version'] = _params['x_version']
344
-
685
+ if x_version is not None:
686
+ _header_params['x-version'] = x_version
687
+ if x_backend_version is not None:
688
+ _header_params['x-backend-version'] = x_backend_version
345
689
  # process the form parameters
346
- _form_params = []
347
- _files = {}
348
690
  # process the body parameter
349
- _body_params = None
691
+
692
+
350
693
  # set the HTTP header `Accept`
351
694
  _header_params['Accept'] = self.api_client.select_header_accept(
352
- ['text/plain', 'application/json', 'text/json']) # noqa: E501
695
+ [
696
+ 'text/plain',
697
+ 'application/json',
698
+ 'text/json'
699
+ ]
700
+ )
353
701
 
354
- # authentication setting
355
- _auth_settings = ['oauth2'] # noqa: E501
356
702
 
357
- _response_types_map = {
358
- '403': "str",
359
- '505': None,
360
- '200': "RawHeatPumpLogDto",
361
- '404': None,
362
- '500': None,
363
- }
703
+ # authentication setting
704
+ _auth_settings: List[str] = [
705
+ 'oauth2'
706
+ ]
364
707
 
365
- return self.api_client.call_api(
366
- '/api/v1/heat-pumps/{heatPumpId}/logs/latest', 'GET',
367
- _path_params,
368
- _query_params,
369
- _header_params,
708
+ return self.api_client.param_serialize(
709
+ method='GET',
710
+ resource_path='/api/v1/heat-pumps/{heatPumpId}/logs/latest',
711
+ path_params=_path_params,
712
+ query_params=_query_params,
713
+ header_params=_header_params,
370
714
  body=_body_params,
371
715
  post_params=_form_params,
372
716
  files=_files,
373
- response_types_map=_response_types_map,
374
717
  auth_settings=_auth_settings,
375
- async_req=_params.get('async_req'),
376
- _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
377
- _preload_content=_params.get('_preload_content', True),
378
- _request_timeout=_params.get('_request_timeout'),
379
718
  collection_formats=_collection_formats,
380
- _request_auth=_params.get('_request_auth'))
719
+ _host=_host,
720
+ _request_auth=_request_auth
721
+ )
722
+
381
723
 
382
- @validate_arguments
383
- def api_v1_heat_pumps_heat_pump_id_logs_raw_get(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The id of the heat pump")], start_time : Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, end_time : Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> List[RawHeatPumpLogDto]: # noqa: E501
384
- """Gets the raw heat pump logs of the heat pump in a from start time to end time for a given interval. Maximum interval is 4 hours. # noqa: E501
385
724
 
386
- This method makes a synchronous HTTP request by default. To make an
387
- asynchronous HTTP request, please pass async_req=True
388
725
 
389
- >>> thread = api.api_v1_heat_pumps_heat_pump_id_logs_raw_get(heat_pump_id, start_time, end_time, x_version, async_req=True)
390
- >>> result = thread.get()
726
+ @validate_call
727
+ async def api_v1_heat_pumps_heat_pump_id_logs_raw_get(
728
+ self,
729
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
730
+ start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
731
+ end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
732
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
733
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
734
+ _request_timeout: Union[
735
+ None,
736
+ Annotated[StrictFloat, Field(gt=0)],
737
+ Tuple[
738
+ Annotated[StrictFloat, Field(gt=0)],
739
+ Annotated[StrictFloat, Field(gt=0)]
740
+ ]
741
+ ] = None,
742
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
743
+ _content_type: Optional[StrictStr] = None,
744
+ _headers: Optional[Dict[StrictStr, Any]] = None,
745
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
746
+ ) -> List[RawHeatPumpLogDto]:
747
+ """Gets the raw heat pump logs of the heat pump in a from start time to end time for a given interval. Maximum interval is 4 hours.
748
+
391
749
 
392
750
  :param heat_pump_id: The id of the heat pump (required)
393
751
  :type heat_pump_id: str
@@ -397,32 +755,84 @@ class HeatPumpLogApi:
397
755
  :type end_time: datetime
398
756
  :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
399
757
  :type x_version: str
400
- :param async_req: Whether to execute the request asynchronously.
401
- :type async_req: bool, optional
402
- :param _request_timeout: timeout setting for this request.
403
- If one number provided, it will be total request
404
- timeout. It can also be a pair (tuple) of
405
- (connection, read) timeouts.
758
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
759
+ :type x_backend_version: str
760
+ :param _request_timeout: timeout setting for this request. If one
761
+ number provided, it will be total request
762
+ timeout. It can also be a pair (tuple) of
763
+ (connection, read) timeouts.
764
+ :type _request_timeout: int, tuple(int, int), optional
765
+ :param _request_auth: set to override the auth_settings for an a single
766
+ request; this effectively ignores the
767
+ authentication in the spec for a single request.
768
+ :type _request_auth: dict, optional
769
+ :param _content_type: force content-type for the request.
770
+ :type _content_type: str, Optional
771
+ :param _headers: set to override the headers for a single
772
+ request; this effectively ignores the headers
773
+ in the spec for a single request.
774
+ :type _headers: dict, optional
775
+ :param _host_index: set to override the host_index for a single
776
+ request; this effectively ignores the host_index
777
+ in the spec for a single request.
778
+ :type _host_index: int, optional
406
779
  :return: Returns the result object.
407
- If the method is called asynchronously,
408
- returns the request thread.
409
- :rtype: List[RawHeatPumpLogDto]
410
- """
411
- kwargs['_return_http_data_only'] = True
412
- if '_preload_content' in kwargs:
413
- message = "Error! Please call the api_v1_heat_pumps_heat_pump_id_logs_raw_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
414
- raise ValueError(message)
415
- return self.api_v1_heat_pumps_heat_pump_id_logs_raw_get_with_http_info(heat_pump_id, start_time, end_time, x_version, **kwargs) # noqa: E501
416
-
417
- @validate_arguments
418
- def api_v1_heat_pumps_heat_pump_id_logs_raw_get_with_http_info(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The id of the heat pump")], start_time : Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, end_time : Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> ApiResponse: # noqa: E501
419
- """Gets the raw heat pump logs of the heat pump in a from start time to end time for a given interval. Maximum interval is 4 hours. # noqa: E501
420
-
421
- This method makes a synchronous HTTP request by default. To make an
422
- asynchronous HTTP request, please pass async_req=True
423
-
424
- >>> thread = api.api_v1_heat_pumps_heat_pump_id_logs_raw_get_with_http_info(heat_pump_id, start_time, end_time, x_version, async_req=True)
425
- >>> result = thread.get()
780
+ """ # noqa: E501
781
+
782
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_raw_get_serialize(
783
+ heat_pump_id=heat_pump_id,
784
+ start_time=start_time,
785
+ end_time=end_time,
786
+ x_version=x_version,
787
+ x_backend_version=x_backend_version,
788
+ _request_auth=_request_auth,
789
+ _content_type=_content_type,
790
+ _headers=_headers,
791
+ _host_index=_host_index
792
+ )
793
+
794
+ _response_types_map: Dict[str, Optional[str]] = {
795
+ '403': "str",
796
+ '500': None,
797
+ '505': None,
798
+ '200': "List[RawHeatPumpLogDto]",
799
+ '400': None,
800
+ '404': None,
801
+ }
802
+ response_data = await self.api_client.call_api(
803
+ *_param,
804
+ _request_timeout=_request_timeout
805
+ )
806
+ await response_data.read()
807
+ return self.api_client.response_deserialize(
808
+ response_data=response_data,
809
+ response_types_map=_response_types_map,
810
+ ).data
811
+
812
+
813
+ @validate_call
814
+ async def api_v1_heat_pumps_heat_pump_id_logs_raw_get_with_http_info(
815
+ self,
816
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
817
+ start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
818
+ end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
819
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
820
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
821
+ _request_timeout: Union[
822
+ None,
823
+ Annotated[StrictFloat, Field(gt=0)],
824
+ Tuple[
825
+ Annotated[StrictFloat, Field(gt=0)],
826
+ Annotated[StrictFloat, Field(gt=0)]
827
+ ]
828
+ ] = None,
829
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
830
+ _content_type: Optional[StrictStr] = None,
831
+ _headers: Optional[Dict[StrictStr, Any]] = None,
832
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
833
+ ) -> ApiResponse[List[RawHeatPumpLogDto]]:
834
+ """Gets the raw heat pump logs of the heat pump in a from start time to end time for a given interval. Maximum interval is 4 hours.
835
+
426
836
 
427
837
  :param heat_pump_id: The id of the heat pump (required)
428
838
  :type heat_pump_id: str
@@ -432,122 +842,236 @@ class HeatPumpLogApi:
432
842
  :type end_time: datetime
433
843
  :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
434
844
  :type x_version: str
435
- :param async_req: Whether to execute the request asynchronously.
436
- :type async_req: bool, optional
437
- :param _preload_content: if False, the ApiResponse.data will
438
- be set to none and raw_data will store the
439
- HTTP response body without reading/decoding.
440
- Default is True.
441
- :type _preload_content: bool, optional
442
- :param _return_http_data_only: response data instead of ApiResponse
443
- object with status code, headers, etc
444
- :type _return_http_data_only: bool, optional
845
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
846
+ :type x_backend_version: str
445
847
  :param _request_timeout: timeout setting for this request. If one
446
848
  number provided, it will be total request
447
849
  timeout. It can also be a pair (tuple) of
448
850
  (connection, read) timeouts.
851
+ :type _request_timeout: int, tuple(int, int), optional
449
852
  :param _request_auth: set to override the auth_settings for an a single
450
- request; this effectively ignores the authentication
451
- in the spec for a single request.
853
+ request; this effectively ignores the
854
+ authentication in the spec for a single request.
452
855
  :type _request_auth: dict, optional
453
- :type _content_type: string, optional: force content-type for the request
856
+ :param _content_type: force content-type for the request.
857
+ :type _content_type: str, Optional
858
+ :param _headers: set to override the headers for a single
859
+ request; this effectively ignores the headers
860
+ in the spec for a single request.
861
+ :type _headers: dict, optional
862
+ :param _host_index: set to override the host_index for a single
863
+ request; this effectively ignores the host_index
864
+ in the spec for a single request.
865
+ :type _host_index: int, optional
454
866
  :return: Returns the result object.
455
- If the method is called asynchronously,
456
- returns the request thread.
457
- :rtype: tuple(List[RawHeatPumpLogDto], status_code(int), headers(HTTPHeaderDict))
458
- """
459
-
460
- _params = locals()
461
-
462
- _all_params = [
463
- 'heat_pump_id',
464
- 'start_time',
465
- 'end_time',
466
- 'x_version'
467
- ]
468
- _all_params.extend(
469
- [
470
- 'async_req',
471
- '_return_http_data_only',
472
- '_preload_content',
473
- '_request_timeout',
474
- '_request_auth',
475
- '_content_type',
476
- '_headers'
867
+ """ # noqa: E501
868
+
869
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_raw_get_serialize(
870
+ heat_pump_id=heat_pump_id,
871
+ start_time=start_time,
872
+ end_time=end_time,
873
+ x_version=x_version,
874
+ x_backend_version=x_backend_version,
875
+ _request_auth=_request_auth,
876
+ _content_type=_content_type,
877
+ _headers=_headers,
878
+ _host_index=_host_index
879
+ )
880
+
881
+ _response_types_map: Dict[str, Optional[str]] = {
882
+ '403': "str",
883
+ '500': None,
884
+ '505': None,
885
+ '200': "List[RawHeatPumpLogDto]",
886
+ '400': None,
887
+ '404': None,
888
+ }
889
+ response_data = await self.api_client.call_api(
890
+ *_param,
891
+ _request_timeout=_request_timeout
892
+ )
893
+ await response_data.read()
894
+ return self.api_client.response_deserialize(
895
+ response_data=response_data,
896
+ response_types_map=_response_types_map,
897
+ )
898
+
899
+
900
+ @validate_call
901
+ async def api_v1_heat_pumps_heat_pump_id_logs_raw_get_without_preload_content(
902
+ self,
903
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
904
+ start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
905
+ end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
906
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
907
+ x_backend_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.")] = None,
908
+ _request_timeout: Union[
909
+ None,
910
+ Annotated[StrictFloat, Field(gt=0)],
911
+ Tuple[
912
+ Annotated[StrictFloat, Field(gt=0)],
913
+ Annotated[StrictFloat, Field(gt=0)]
477
914
  ]
915
+ ] = None,
916
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
917
+ _content_type: Optional[StrictStr] = None,
918
+ _headers: Optional[Dict[StrictStr, Any]] = None,
919
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
920
+ ) -> RESTResponseType:
921
+ """Gets the raw heat pump logs of the heat pump in a from start time to end time for a given interval. Maximum interval is 4 hours.
922
+
923
+
924
+ :param heat_pump_id: The id of the heat pump (required)
925
+ :type heat_pump_id: str
926
+ :param start_time: Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)
927
+ :type start_time: datetime
928
+ :param end_time: End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)
929
+ :type end_time: datetime
930
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
931
+ :type x_version: str
932
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
933
+ :type x_backend_version: str
934
+ :param _request_timeout: timeout setting for this request. If one
935
+ number provided, it will be total request
936
+ timeout. It can also be a pair (tuple) of
937
+ (connection, read) timeouts.
938
+ :type _request_timeout: int, tuple(int, int), optional
939
+ :param _request_auth: set to override the auth_settings for an a single
940
+ request; this effectively ignores the
941
+ authentication in the spec for a single request.
942
+ :type _request_auth: dict, optional
943
+ :param _content_type: force content-type for the request.
944
+ :type _content_type: str, Optional
945
+ :param _headers: set to override the headers for a single
946
+ request; this effectively ignores the headers
947
+ in the spec for a single request.
948
+ :type _headers: dict, optional
949
+ :param _host_index: set to override the host_index for a single
950
+ request; this effectively ignores the host_index
951
+ in the spec for a single request.
952
+ :type _host_index: int, optional
953
+ :return: Returns the result object.
954
+ """ # noqa: E501
955
+
956
+ _param = self._api_v1_heat_pumps_heat_pump_id_logs_raw_get_serialize(
957
+ heat_pump_id=heat_pump_id,
958
+ start_time=start_time,
959
+ end_time=end_time,
960
+ x_version=x_version,
961
+ x_backend_version=x_backend_version,
962
+ _request_auth=_request_auth,
963
+ _content_type=_content_type,
964
+ _headers=_headers,
965
+ _host_index=_host_index
478
966
  )
479
967
 
480
- # validate the arguments
481
- for _key, _val in _params['kwargs'].items():
482
- if _key not in _all_params:
483
- raise ApiTypeError(
484
- "Got an unexpected keyword argument '%s'"
485
- " to method api_v1_heat_pumps_heat_pump_id_logs_raw_get" % _key
486
- )
487
- _params[_key] = _val
488
- del _params['kwargs']
968
+ _response_types_map: Dict[str, Optional[str]] = {
969
+ '403': "str",
970
+ '500': None,
971
+ '505': None,
972
+ '200': "List[RawHeatPumpLogDto]",
973
+ '400': None,
974
+ '404': None,
975
+ }
976
+ response_data = await self.api_client.call_api(
977
+ *_param,
978
+ _request_timeout=_request_timeout
979
+ )
980
+ return response_data.response
489
981
 
490
- _collection_formats = {}
491
982
 
492
- # process the path parameters
493
- _path_params = {}
494
- if _params['heat_pump_id'] is not None:
495
- _path_params['heatPumpId'] = _params['heat_pump_id']
983
+ def _api_v1_heat_pumps_heat_pump_id_logs_raw_get_serialize(
984
+ self,
985
+ heat_pump_id,
986
+ start_time,
987
+ end_time,
988
+ x_version,
989
+ x_backend_version,
990
+ _request_auth,
991
+ _content_type,
992
+ _headers,
993
+ _host_index,
994
+ ) -> Tuple:
496
995
 
996
+ _host = None
497
997
 
998
+ _collection_formats: Dict[str, str] = {
999
+ }
1000
+
1001
+ _path_params: Dict[str, str] = {}
1002
+ _query_params: List[Tuple[str, str]] = []
1003
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1004
+ _form_params: List[Tuple[str, str]] = []
1005
+ _files: Dict[str, str] = {}
1006
+ _body_params: Optional[bytes] = None
1007
+
1008
+ # process the path parameters
1009
+ if heat_pump_id is not None:
1010
+ _path_params['heatPumpId'] = heat_pump_id
498
1011
  # process the query parameters
499
- _query_params = []
500
- if _params.get('start_time') is not None: # noqa: E501
501
- if isinstance(_params['start_time'], datetime):
502
- _query_params.append(('startTime', _params['start_time'].strftime(self.api_client.configuration.datetime_format)))
1012
+ if start_time is not None:
1013
+ if isinstance(start_time, datetime):
1014
+ _query_params.append(
1015
+ (
1016
+ 'startTime',
1017
+ start_time.strftime(
1018
+ self.api_client.configuration.datetime_format
1019
+ )
1020
+ )
1021
+ )
503
1022
  else:
504
- _query_params.append(('startTime', _params['start_time']))
505
-
506
- if _params.get('end_time') is not None: # noqa: E501
507
- if isinstance(_params['end_time'], datetime):
508
- _query_params.append(('endTime', _params['end_time'].strftime(self.api_client.configuration.datetime_format)))
1023
+ _query_params.append(('startTime', start_time))
1024
+
1025
+ if end_time is not None:
1026
+ if isinstance(end_time, datetime):
1027
+ _query_params.append(
1028
+ (
1029
+ 'endTime',
1030
+ end_time.strftime(
1031
+ self.api_client.configuration.datetime_format
1032
+ )
1033
+ )
1034
+ )
509
1035
  else:
510
- _query_params.append(('endTime', _params['end_time']))
511
-
1036
+ _query_params.append(('endTime', end_time))
1037
+
512
1038
  # process the header parameters
513
- _header_params = dict(_params.get('_headers', {}))
514
- if _params['x_version'] is not None:
515
- _header_params['x-version'] = _params['x_version']
516
-
1039
+ if x_version is not None:
1040
+ _header_params['x-version'] = x_version
1041
+ if x_backend_version is not None:
1042
+ _header_params['x-backend-version'] = x_backend_version
517
1043
  # process the form parameters
518
- _form_params = []
519
- _files = {}
520
1044
  # process the body parameter
521
- _body_params = None
1045
+
1046
+
522
1047
  # set the HTTP header `Accept`
523
1048
  _header_params['Accept'] = self.api_client.select_header_accept(
524
- ['text/plain', 'application/json', 'text/json']) # noqa: E501
1049
+ [
1050
+ 'text/plain',
1051
+ 'application/json',
1052
+ 'text/json'
1053
+ ]
1054
+ )
525
1055
 
526
- # authentication setting
527
- _auth_settings = ['oauth2'] # noqa: E501
528
1056
 
529
- _response_types_map = {
530
- '403': "str",
531
- '505': None,
532
- '200': "List[RawHeatPumpLogDto]",
533
- '400': None,
534
- '404': None,
535
- '500': None,
536
- }
1057
+ # authentication setting
1058
+ _auth_settings: List[str] = [
1059
+ 'oauth2'
1060
+ ]
537
1061
 
538
- return self.api_client.call_api(
539
- '/api/v1/heat-pumps/{heatPumpId}/logs/raw', 'GET',
540
- _path_params,
541
- _query_params,
542
- _header_params,
1062
+ return self.api_client.param_serialize(
1063
+ method='GET',
1064
+ resource_path='/api/v1/heat-pumps/{heatPumpId}/logs/raw',
1065
+ path_params=_path_params,
1066
+ query_params=_query_params,
1067
+ header_params=_header_params,
543
1068
  body=_body_params,
544
1069
  post_params=_form_params,
545
1070
  files=_files,
546
- response_types_map=_response_types_map,
547
1071
  auth_settings=_auth_settings,
548
- async_req=_params.get('async_req'),
549
- _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
550
- _preload_content=_params.get('_preload_content', True),
551
- _request_timeout=_params.get('_request_timeout'),
552
1072
  collection_formats=_collection_formats,
553
- _request_auth=_params.get('_request_auth'))
1073
+ _host=_host,
1074
+ _request_auth=_request_auth
1075
+ )
1076
+
1077
+