weheat 2025.1.14rc1__py3-none-any.whl → 2025.1.15rc1__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.

Potentially problematic release.


This version of weheat might be problematic. Click here for more details.

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