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,27 +12,31 @@
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.energy_view_dto import EnergyViewDto
35
+ from weheat.models.total_energy_aggregate import TotalEnergyAggregate
29
36
 
30
37
  from weheat.api_client import ApiClient
31
38
  from weheat.api_response import ApiResponse
32
- from weheat.exceptions import ( # noqa: F401
33
- ApiTypeError,
34
- ApiValueError
35
- )
39
+ from weheat.rest import RESTResponseType
36
40
 
37
41
 
38
42
  class EnergyLogApi:
@@ -47,15 +51,31 @@ class EnergyLogApi:
47
51
  api_client = ApiClient.get_default()
48
52
  self.api_client = api_client
49
53
 
50
- @validate_arguments
51
- def api_v1_energy_logs_heat_pump_id_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: \"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[EnergyViewDto]: # noqa: E501
52
- """Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals # noqa: E501
53
54
 
54
- This method makes a synchronous HTTP request by default. To make an
55
- asynchronous HTTP request, please pass async_req=True
55
+ @validate_call
56
+ async def api_v1_energy_logs_heat_pump_id_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: \"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
+ 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,
64
+ _request_timeout: Union[
65
+ None,
66
+ Annotated[StrictFloat, Field(gt=0)],
67
+ Tuple[
68
+ Annotated[StrictFloat, Field(gt=0)],
69
+ Annotated[StrictFloat, Field(gt=0)]
70
+ ]
71
+ ] = None,
72
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
73
+ _content_type: Optional[StrictStr] = None,
74
+ _headers: Optional[Dict[StrictStr, Any]] = None,
75
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
76
+ ) -> List[EnergyViewDto]:
77
+ """Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals
56
78
 
57
- >>> thread = api.api_v1_energy_logs_heat_pump_id_get(heat_pump_id, start_time, end_time, interval, x_version, async_req=True)
58
- >>> result = thread.get()
59
79
 
60
80
  :param heat_pump_id: The id of the heat pump (required)
61
81
  :type heat_pump_id: str
@@ -67,32 +87,85 @@ class EnergyLogApi:
67
87
  :type interval: str
68
88
  :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
69
89
  :type x_version: str
70
- :param async_req: Whether to execute the request asynchronously.
71
- :type async_req: bool, optional
72
- :param _request_timeout: timeout setting for this request.
73
- If one number provided, it will be total request
74
- timeout. It can also be a pair (tuple) of
75
- (connection, read) timeouts.
90
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
91
+ :type x_backend_version: str
92
+ :param _request_timeout: timeout setting for this request. If one
93
+ number provided, it will be total request
94
+ timeout. It can also be a pair (tuple) of
95
+ (connection, read) timeouts.
96
+ :type _request_timeout: int, tuple(int, int), optional
97
+ :param _request_auth: set to override the auth_settings for an a single
98
+ request; this effectively ignores the
99
+ authentication in the spec for a single request.
100
+ :type _request_auth: dict, optional
101
+ :param _content_type: force content-type for the request.
102
+ :type _content_type: str, Optional
103
+ :param _headers: set to override the headers for a single
104
+ request; this effectively ignores the headers
105
+ in the spec for a single request.
106
+ :type _headers: dict, optional
107
+ :param _host_index: set to override the host_index for a single
108
+ request; this effectively ignores the host_index
109
+ in the spec for a single request.
110
+ :type _host_index: int, optional
76
111
  :return: Returns the result object.
77
- If the method is called asynchronously,
78
- returns the request thread.
79
- :rtype: List[EnergyViewDto]
80
- """
81
- kwargs['_return_http_data_only'] = True
82
- if '_preload_content' in kwargs:
83
- message = "Error! Please call the api_v1_energy_logs_heat_pump_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
84
- raise ValueError(message)
85
- return self.api_v1_energy_logs_heat_pump_id_get_with_http_info(heat_pump_id, start_time, end_time, interval, x_version, **kwargs) # noqa: E501
86
-
87
- @validate_arguments
88
- def api_v1_energy_logs_heat_pump_id_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: \"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
89
- """Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals # noqa: E501
90
-
91
- This method makes a synchronous HTTP request by default. To make an
92
- asynchronous HTTP request, please pass async_req=True
93
-
94
- >>> thread = api.api_v1_energy_logs_heat_pump_id_get_with_http_info(heat_pump_id, start_time, end_time, interval, x_version, async_req=True)
95
- >>> result = thread.get()
112
+ """ # noqa: E501
113
+
114
+ _param = self._api_v1_energy_logs_heat_pump_id_get_serialize(
115
+ heat_pump_id=heat_pump_id,
116
+ start_time=start_time,
117
+ end_time=end_time,
118
+ interval=interval,
119
+ x_version=x_version,
120
+ x_backend_version=x_backend_version,
121
+ _request_auth=_request_auth,
122
+ _content_type=_content_type,
123
+ _headers=_headers,
124
+ _host_index=_host_index
125
+ )
126
+
127
+ _response_types_map: Dict[str, Optional[str]] = {
128
+ '403': "str",
129
+ '500': None,
130
+ '505': None,
131
+ '200': "List[EnergyViewDto]",
132
+ '400': None,
133
+ }
134
+ response_data = await self.api_client.call_api(
135
+ *_param,
136
+ _request_timeout=_request_timeout
137
+ )
138
+ await response_data.read()
139
+ return self.api_client.response_deserialize(
140
+ response_data=response_data,
141
+ response_types_map=_response_types_map,
142
+ ).data
143
+
144
+
145
+ @validate_call
146
+ async def api_v1_energy_logs_heat_pump_id_get_with_http_info(
147
+ self,
148
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
149
+ 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,
150
+ 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,
151
+ interval: Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None,
152
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
153
+ 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,
154
+ _request_timeout: Union[
155
+ None,
156
+ Annotated[StrictFloat, Field(gt=0)],
157
+ Tuple[
158
+ Annotated[StrictFloat, Field(gt=0)],
159
+ Annotated[StrictFloat, Field(gt=0)]
160
+ ]
161
+ ] = None,
162
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
163
+ _content_type: Optional[StrictStr] = None,
164
+ _headers: Optional[Dict[StrictStr, Any]] = None,
165
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
166
+ ) -> ApiResponse[List[EnergyViewDto]]:
167
+ """Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals
168
+
96
169
 
97
170
  :param heat_pump_id: The id of the heat pump (required)
98
171
  :type heat_pump_id: str
@@ -104,125 +177,540 @@ class EnergyLogApi:
104
177
  :type interval: str
105
178
  :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
106
179
  :type x_version: str
107
- :param async_req: Whether to execute the request asynchronously.
108
- :type async_req: bool, optional
109
- :param _preload_content: if False, the ApiResponse.data will
110
- be set to none and raw_data will store the
111
- HTTP response body without reading/decoding.
112
- Default is True.
113
- :type _preload_content: bool, optional
114
- :param _return_http_data_only: response data instead of ApiResponse
115
- object with status code, headers, etc
116
- :type _return_http_data_only: bool, optional
180
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
181
+ :type x_backend_version: str
117
182
  :param _request_timeout: timeout setting for this request. If one
118
183
  number provided, it will be total request
119
184
  timeout. It can also be a pair (tuple) of
120
185
  (connection, read) timeouts.
186
+ :type _request_timeout: int, tuple(int, int), optional
121
187
  :param _request_auth: set to override the auth_settings for an a single
122
- request; this effectively ignores the authentication
123
- in the spec for a single request.
188
+ request; this effectively ignores the
189
+ authentication in the spec for a single request.
124
190
  :type _request_auth: dict, optional
125
- :type _content_type: string, optional: force content-type for the request
191
+ :param _content_type: force content-type for the request.
192
+ :type _content_type: str, Optional
193
+ :param _headers: set to override the headers for a single
194
+ request; this effectively ignores the headers
195
+ in the spec for a single request.
196
+ :type _headers: dict, optional
197
+ :param _host_index: set to override the host_index for a single
198
+ request; this effectively ignores the host_index
199
+ in the spec for a single request.
200
+ :type _host_index: int, optional
126
201
  :return: Returns the result object.
127
- If the method is called asynchronously,
128
- returns the request thread.
129
- :rtype: tuple(List[EnergyViewDto], status_code(int), headers(HTTPHeaderDict))
130
- """
131
-
132
- _params = locals()
133
-
134
- _all_params = [
135
- 'heat_pump_id',
136
- 'start_time',
137
- 'end_time',
138
- 'interval',
139
- 'x_version'
140
- ]
141
- _all_params.extend(
142
- [
143
- 'async_req',
144
- '_return_http_data_only',
145
- '_preload_content',
146
- '_request_timeout',
147
- '_request_auth',
148
- '_content_type',
149
- '_headers'
150
- ]
202
+ """ # noqa: E501
203
+
204
+ _param = self._api_v1_energy_logs_heat_pump_id_get_serialize(
205
+ heat_pump_id=heat_pump_id,
206
+ start_time=start_time,
207
+ end_time=end_time,
208
+ interval=interval,
209
+ x_version=x_version,
210
+ x_backend_version=x_backend_version,
211
+ _request_auth=_request_auth,
212
+ _content_type=_content_type,
213
+ _headers=_headers,
214
+ _host_index=_host_index
151
215
  )
152
216
 
153
- # validate the arguments
154
- for _key, _val in _params['kwargs'].items():
155
- if _key not in _all_params:
156
- raise ApiTypeError(
157
- "Got an unexpected keyword argument '%s'"
158
- " to method api_v1_energy_logs_heat_pump_id_get" % _key
159
- )
160
- _params[_key] = _val
161
- del _params['kwargs']
217
+ _response_types_map: Dict[str, Optional[str]] = {
218
+ '403': "str",
219
+ '500': None,
220
+ '505': None,
221
+ '200': "List[EnergyViewDto]",
222
+ '400': None,
223
+ }
224
+ response_data = await self.api_client.call_api(
225
+ *_param,
226
+ _request_timeout=_request_timeout
227
+ )
228
+ await response_data.read()
229
+ return self.api_client.response_deserialize(
230
+ response_data=response_data,
231
+ response_types_map=_response_types_map,
232
+ )
162
233
 
163
- _collection_formats = {}
164
234
 
165
- # process the path parameters
166
- _path_params = {}
167
- if _params['heat_pump_id'] is not None:
168
- _path_params['heatPumpId'] = _params['heat_pump_id']
235
+ @validate_call
236
+ async def api_v1_energy_logs_heat_pump_id_get_without_preload_content(
237
+ self,
238
+ heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
239
+ 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,
240
+ 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,
241
+ interval: Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None,
242
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
243
+ 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,
244
+ _request_timeout: Union[
245
+ None,
246
+ Annotated[StrictFloat, Field(gt=0)],
247
+ Tuple[
248
+ Annotated[StrictFloat, Field(gt=0)],
249
+ Annotated[StrictFloat, Field(gt=0)]
250
+ ]
251
+ ] = None,
252
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
253
+ _content_type: Optional[StrictStr] = None,
254
+ _headers: Optional[Dict[StrictStr, Any]] = None,
255
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
256
+ ) -> RESTResponseType:
257
+ """Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals
169
258
 
170
259
 
171
- # process the query parameters
172
- _query_params = []
173
- if _params.get('start_time') is not None: # noqa: E501
174
- if isinstance(_params['start_time'], datetime):
175
- _query_params.append(('startTime', _params['start_time'].strftime(self.api_client.configuration.datetime_format)))
176
- else:
177
- _query_params.append(('startTime', _params['start_time']))
260
+ :param heat_pump_id: The id of the heat pump (required)
261
+ :type heat_pump_id: str
262
+ :param start_time: Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)
263
+ :type start_time: datetime
264
+ :param end_time: End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)
265
+ :type end_time: datetime
266
+ :param interval: Interval granularity of the log data, allowed intervals: \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"
267
+ :type interval: str
268
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
269
+ :type x_version: str
270
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
271
+ :type x_backend_version: str
272
+ :param _request_timeout: timeout setting for this request. If one
273
+ number provided, it will be total request
274
+ timeout. It can also be a pair (tuple) of
275
+ (connection, read) timeouts.
276
+ :type _request_timeout: int, tuple(int, int), optional
277
+ :param _request_auth: set to override the auth_settings for an a single
278
+ request; this effectively ignores the
279
+ authentication in the spec for a single request.
280
+ :type _request_auth: dict, optional
281
+ :param _content_type: force content-type for the request.
282
+ :type _content_type: str, Optional
283
+ :param _headers: set to override the headers for a single
284
+ request; this effectively ignores the headers
285
+ in the spec for a single request.
286
+ :type _headers: dict, optional
287
+ :param _host_index: set to override the host_index for a single
288
+ request; this effectively ignores the host_index
289
+ in the spec for a single request.
290
+ :type _host_index: int, optional
291
+ :return: Returns the result object.
292
+ """ # noqa: E501
293
+
294
+ _param = self._api_v1_energy_logs_heat_pump_id_get_serialize(
295
+ heat_pump_id=heat_pump_id,
296
+ start_time=start_time,
297
+ end_time=end_time,
298
+ interval=interval,
299
+ x_version=x_version,
300
+ x_backend_version=x_backend_version,
301
+ _request_auth=_request_auth,
302
+ _content_type=_content_type,
303
+ _headers=_headers,
304
+ _host_index=_host_index
305
+ )
178
306
 
179
- if _params.get('end_time') is not None: # noqa: E501
180
- if isinstance(_params['end_time'], datetime):
181
- _query_params.append(('endTime', _params['end_time'].strftime(self.api_client.configuration.datetime_format)))
182
- else:
183
- _query_params.append(('endTime', _params['end_time']))
307
+ _response_types_map: Dict[str, Optional[str]] = {
308
+ '403': "str",
309
+ '500': None,
310
+ '505': None,
311
+ '200': "List[EnergyViewDto]",
312
+ '400': None,
313
+ }
314
+ response_data = await self.api_client.call_api(
315
+ *_param,
316
+ _request_timeout=_request_timeout
317
+ )
318
+ return response_data.response
319
+
320
+
321
+ def _api_v1_energy_logs_heat_pump_id_get_serialize(
322
+ self,
323
+ heat_pump_id,
324
+ start_time,
325
+ end_time,
326
+ interval,
327
+ x_version,
328
+ x_backend_version,
329
+ _request_auth,
330
+ _content_type,
331
+ _headers,
332
+ _host_index,
333
+ ) -> Tuple:
334
+
335
+ _host = None
336
+
337
+ _collection_formats: Dict[str, str] = {
338
+ }
184
339
 
185
- if _params.get('interval') is not None: # noqa: E501
186
- _query_params.append(('interval', _params['interval']))
340
+ _path_params: Dict[str, str] = {}
341
+ _query_params: List[Tuple[str, str]] = []
342
+ _header_params: Dict[str, Optional[str]] = _headers or {}
343
+ _form_params: List[Tuple[str, str]] = []
344
+ _files: Dict[str, str] = {}
345
+ _body_params: Optional[bytes] = None
187
346
 
347
+ # process the path parameters
348
+ if heat_pump_id is not None:
349
+ _path_params['heatPumpId'] = heat_pump_id
350
+ # process the query parameters
351
+ if start_time is not None:
352
+ if isinstance(start_time, datetime):
353
+ _query_params.append(
354
+ (
355
+ 'startTime',
356
+ start_time.strftime(
357
+ self.api_client.configuration.datetime_format
358
+ )
359
+ )
360
+ )
361
+ else:
362
+ _query_params.append(('startTime', start_time))
363
+
364
+ if end_time is not None:
365
+ if isinstance(end_time, datetime):
366
+ _query_params.append(
367
+ (
368
+ 'endTime',
369
+ end_time.strftime(
370
+ self.api_client.configuration.datetime_format
371
+ )
372
+ )
373
+ )
374
+ else:
375
+ _query_params.append(('endTime', end_time))
376
+
377
+ if interval is not None:
378
+
379
+ _query_params.append(('interval', interval))
380
+
188
381
  # process the header parameters
189
- _header_params = dict(_params.get('_headers', {}))
190
- if _params['x_version'] is not None:
191
- _header_params['x-version'] = _params['x_version']
192
-
382
+ if x_version is not None:
383
+ _header_params['x-version'] = x_version
384
+ if x_backend_version is not None:
385
+ _header_params['x-backend-version'] = x_backend_version
193
386
  # process the form parameters
194
- _form_params = []
195
- _files = {}
196
387
  # process the body parameter
197
- _body_params = None
388
+
389
+
198
390
  # set the HTTP header `Accept`
199
391
  _header_params['Accept'] = self.api_client.select_header_accept(
200
- ['text/plain', 'application/json', 'text/json']) # noqa: E501
392
+ [
393
+ 'text/plain',
394
+ 'application/json',
395
+ 'text/json'
396
+ ]
397
+ )
398
+
201
399
 
202
400
  # authentication setting
203
- _auth_settings = ['oauth2'] # noqa: E501
401
+ _auth_settings: List[str] = [
402
+ 'oauth2'
403
+ ]
404
+
405
+ return self.api_client.param_serialize(
406
+ method='GET',
407
+ resource_path='/api/v1/energy-logs/{heatPumpId}',
408
+ path_params=_path_params,
409
+ query_params=_query_params,
410
+ header_params=_header_params,
411
+ body=_body_params,
412
+ post_params=_form_params,
413
+ files=_files,
414
+ auth_settings=_auth_settings,
415
+ collection_formats=_collection_formats,
416
+ _host=_host,
417
+ _request_auth=_request_auth
418
+ )
419
+
420
+
421
+
422
+
423
+ @validate_call
424
+ async def total_heat_pump_id_get(
425
+ self,
426
+ heat_pump_id: StrictStr,
427
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
428
+ 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,
429
+ _request_timeout: Union[
430
+ None,
431
+ Annotated[StrictFloat, Field(gt=0)],
432
+ Tuple[
433
+ Annotated[StrictFloat, Field(gt=0)],
434
+ Annotated[StrictFloat, Field(gt=0)]
435
+ ]
436
+ ] = None,
437
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
438
+ _content_type: Optional[StrictStr] = None,
439
+ _headers: Optional[Dict[StrictStr, Any]] = None,
440
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
441
+ ) -> TotalEnergyAggregate:
442
+ """total_heat_pump_id_get
443
+
204
444
 
205
- _response_types_map = {
445
+ :param heat_pump_id: (required)
446
+ :type heat_pump_id: str
447
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
448
+ :type x_version: str
449
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
450
+ :type x_backend_version: str
451
+ :param _request_timeout: timeout setting for this request. If one
452
+ number provided, it will be total request
453
+ timeout. It can also be a pair (tuple) of
454
+ (connection, read) timeouts.
455
+ :type _request_timeout: int, tuple(int, int), optional
456
+ :param _request_auth: set to override the auth_settings for an a single
457
+ request; this effectively ignores the
458
+ authentication in the spec for a single request.
459
+ :type _request_auth: dict, optional
460
+ :param _content_type: force content-type for the request.
461
+ :type _content_type: str, Optional
462
+ :param _headers: set to override the headers for a single
463
+ request; this effectively ignores the headers
464
+ in the spec for a single request.
465
+ :type _headers: dict, optional
466
+ :param _host_index: set to override the host_index for a single
467
+ request; this effectively ignores the host_index
468
+ in the spec for a single request.
469
+ :type _host_index: int, optional
470
+ :return: Returns the result object.
471
+ """ # noqa: E501
472
+
473
+ _param = self._total_heat_pump_id_get_serialize(
474
+ heat_pump_id=heat_pump_id,
475
+ x_version=x_version,
476
+ x_backend_version=x_backend_version,
477
+ _request_auth=_request_auth,
478
+ _content_type=_content_type,
479
+ _headers=_headers,
480
+ _host_index=_host_index
481
+ )
482
+
483
+ _response_types_map: Dict[str, Optional[str]] = {
206
484
  '403': "str",
485
+ '500': None,
207
486
  '505': None,
208
- '200': "List[EnergyViewDto]",
209
- '400': None,
487
+ '200': "TotalEnergyAggregate",
488
+ }
489
+ response_data = await self.api_client.call_api(
490
+ *_param,
491
+ _request_timeout=_request_timeout
492
+ )
493
+ await response_data.read()
494
+ return self.api_client.response_deserialize(
495
+ response_data=response_data,
496
+ response_types_map=_response_types_map,
497
+ ).data
498
+
499
+
500
+ @validate_call
501
+ async def total_heat_pump_id_get_with_http_info(
502
+ self,
503
+ heat_pump_id: StrictStr,
504
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
505
+ 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,
506
+ _request_timeout: Union[
507
+ None,
508
+ Annotated[StrictFloat, Field(gt=0)],
509
+ Tuple[
510
+ Annotated[StrictFloat, Field(gt=0)],
511
+ Annotated[StrictFloat, Field(gt=0)]
512
+ ]
513
+ ] = None,
514
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
515
+ _content_type: Optional[StrictStr] = None,
516
+ _headers: Optional[Dict[StrictStr, Any]] = None,
517
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
518
+ ) -> ApiResponse[TotalEnergyAggregate]:
519
+ """total_heat_pump_id_get
520
+
521
+
522
+ :param heat_pump_id: (required)
523
+ :type heat_pump_id: str
524
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
525
+ :type x_version: str
526
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
527
+ :type x_backend_version: str
528
+ :param _request_timeout: timeout setting for this request. If one
529
+ number provided, it will be total request
530
+ timeout. It can also be a pair (tuple) of
531
+ (connection, read) timeouts.
532
+ :type _request_timeout: int, tuple(int, int), optional
533
+ :param _request_auth: set to override the auth_settings for an a single
534
+ request; this effectively ignores the
535
+ authentication in the spec for a single request.
536
+ :type _request_auth: dict, optional
537
+ :param _content_type: force content-type for the request.
538
+ :type _content_type: str, Optional
539
+ :param _headers: set to override the headers for a single
540
+ request; this effectively ignores the headers
541
+ in the spec for a single request.
542
+ :type _headers: dict, optional
543
+ :param _host_index: set to override the host_index for a single
544
+ request; this effectively ignores the host_index
545
+ in the spec for a single request.
546
+ :type _host_index: int, optional
547
+ :return: Returns the result object.
548
+ """ # noqa: E501
549
+
550
+ _param = self._total_heat_pump_id_get_serialize(
551
+ heat_pump_id=heat_pump_id,
552
+ x_version=x_version,
553
+ x_backend_version=x_backend_version,
554
+ _request_auth=_request_auth,
555
+ _content_type=_content_type,
556
+ _headers=_headers,
557
+ _host_index=_host_index
558
+ )
559
+
560
+ _response_types_map: Dict[str, Optional[str]] = {
561
+ '403': "str",
210
562
  '500': None,
563
+ '505': None,
564
+ '200': "TotalEnergyAggregate",
211
565
  }
566
+ response_data = await self.api_client.call_api(
567
+ *_param,
568
+ _request_timeout=_request_timeout
569
+ )
570
+ await response_data.read()
571
+ return self.api_client.response_deserialize(
572
+ response_data=response_data,
573
+ response_types_map=_response_types_map,
574
+ )
212
575
 
213
- return self.api_client.call_api(
214
- '/api/v1/energy-logs/{heatPumpId}', 'GET',
215
- _path_params,
216
- _query_params,
217
- _header_params,
576
+
577
+ @validate_call
578
+ async def total_heat_pump_id_get_without_preload_content(
579
+ self,
580
+ heat_pump_id: StrictStr,
581
+ x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
582
+ 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,
583
+ _request_timeout: Union[
584
+ None,
585
+ Annotated[StrictFloat, Field(gt=0)],
586
+ Tuple[
587
+ Annotated[StrictFloat, Field(gt=0)],
588
+ Annotated[StrictFloat, Field(gt=0)]
589
+ ]
590
+ ] = None,
591
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
592
+ _content_type: Optional[StrictStr] = None,
593
+ _headers: Optional[Dict[StrictStr, Any]] = None,
594
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
595
+ ) -> RESTResponseType:
596
+ """total_heat_pump_id_get
597
+
598
+
599
+ :param heat_pump_id: (required)
600
+ :type heat_pump_id: str
601
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
602
+ :type x_version: str
603
+ :param x_backend_version: Optional version parameter that the frontend can use to know whether this specific endpoint got a backwards incompatible change.
604
+ :type x_backend_version: str
605
+ :param _request_timeout: timeout setting for this request. If one
606
+ number provided, it will be total request
607
+ timeout. It can also be a pair (tuple) of
608
+ (connection, read) timeouts.
609
+ :type _request_timeout: int, tuple(int, int), optional
610
+ :param _request_auth: set to override the auth_settings for an a single
611
+ request; this effectively ignores the
612
+ authentication in the spec for a single request.
613
+ :type _request_auth: dict, optional
614
+ :param _content_type: force content-type for the request.
615
+ :type _content_type: str, Optional
616
+ :param _headers: set to override the headers for a single
617
+ request; this effectively ignores the headers
618
+ in the spec for a single request.
619
+ :type _headers: dict, optional
620
+ :param _host_index: set to override the host_index for a single
621
+ request; this effectively ignores the host_index
622
+ in the spec for a single request.
623
+ :type _host_index: int, optional
624
+ :return: Returns the result object.
625
+ """ # noqa: E501
626
+
627
+ _param = self._total_heat_pump_id_get_serialize(
628
+ heat_pump_id=heat_pump_id,
629
+ x_version=x_version,
630
+ x_backend_version=x_backend_version,
631
+ _request_auth=_request_auth,
632
+ _content_type=_content_type,
633
+ _headers=_headers,
634
+ _host_index=_host_index
635
+ )
636
+
637
+ _response_types_map: Dict[str, Optional[str]] = {
638
+ '403': "str",
639
+ '500': None,
640
+ '505': None,
641
+ '200': "TotalEnergyAggregate",
642
+ }
643
+ response_data = await self.api_client.call_api(
644
+ *_param,
645
+ _request_timeout=_request_timeout
646
+ )
647
+ return response_data.response
648
+
649
+
650
+ def _total_heat_pump_id_get_serialize(
651
+ self,
652
+ heat_pump_id,
653
+ x_version,
654
+ x_backend_version,
655
+ _request_auth,
656
+ _content_type,
657
+ _headers,
658
+ _host_index,
659
+ ) -> Tuple:
660
+
661
+ _host = None
662
+
663
+ _collection_formats: Dict[str, str] = {
664
+ }
665
+
666
+ _path_params: Dict[str, str] = {}
667
+ _query_params: List[Tuple[str, str]] = []
668
+ _header_params: Dict[str, Optional[str]] = _headers or {}
669
+ _form_params: List[Tuple[str, str]] = []
670
+ _files: Dict[str, str] = {}
671
+ _body_params: Optional[bytes] = None
672
+
673
+ # process the path parameters
674
+ if heat_pump_id is not None:
675
+ _path_params['heatPumpId'] = heat_pump_id
676
+ # process the query parameters
677
+ # process the header parameters
678
+ if x_version is not None:
679
+ _header_params['x-version'] = x_version
680
+ if x_backend_version is not None:
681
+ _header_params['x-backend-version'] = x_backend_version
682
+ # process the form parameters
683
+ # process the body parameter
684
+
685
+
686
+ # set the HTTP header `Accept`
687
+ _header_params['Accept'] = self.api_client.select_header_accept(
688
+ [
689
+ 'text/plain',
690
+ 'application/json',
691
+ 'text/json'
692
+ ]
693
+ )
694
+
695
+
696
+ # authentication setting
697
+ _auth_settings: List[str] = [
698
+ 'oauth2'
699
+ ]
700
+
701
+ return self.api_client.param_serialize(
702
+ method='GET',
703
+ resource_path='/api/v1/energy-logs/{heatPumpId}/total',
704
+ path_params=_path_params,
705
+ query_params=_query_params,
706
+ header_params=_header_params,
218
707
  body=_body_params,
219
708
  post_params=_form_params,
220
709
  files=_files,
221
- response_types_map=_response_types_map,
222
710
  auth_settings=_auth_settings,
223
- async_req=_params.get('async_req'),
224
- _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
225
- _preload_content=_params.get('_preload_content', True),
226
- _request_timeout=_params.get('_request_timeout'),
227
711
  collection_formats=_collection_formats,
228
- _request_auth=_params.get('_request_auth'))
712
+ _host=_host,
713
+ _request_auth=_request_auth
714
+ )
715
+
716
+