weheat 2025.1.14rc1__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.

@@ -0,0 +1,532 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Weheat Backend
5
+
6
+ This is the backend for the Weheat project
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ import re # noqa: F401
16
+ import io
17
+ import warnings
18
+
19
+ try:
20
+ from pydantic.v1 import validate_arguments, Field, StrictInt, StrictStr
21
+ except ImportError:
22
+ from pydantic import validate_arguments, Field, StrictInt, StrictStr
23
+
24
+ from typing_extensions import Annotated
25
+
26
+ from typing import List, Optional
27
+
28
+ from weheat.models.device_state import DeviceState
29
+ from weheat.models.read_all_heat_pump_dto import ReadAllHeatPumpDto
30
+ from weheat.models.read_heat_pump_dto import ReadHeatPumpDto
31
+
32
+ from weheat.api_client import ApiClient
33
+ from weheat.api_response import ApiResponse
34
+ from weheat.exceptions import ( # noqa: F401
35
+ ApiTypeError,
36
+ ApiValueError
37
+ )
38
+
39
+
40
+ class HeatPumpApi:
41
+ """NOTE: This class is auto generated by OpenAPI Generator
42
+ Ref: https://openapi-generator.tech
43
+
44
+ Do not edit the class manually.
45
+ """
46
+
47
+ def __init__(self, api_client=None) -> None:
48
+ if api_client is None:
49
+ api_client = ApiClient.get_default()
50
+ self.api_client = api_client
51
+
52
+ @validate_arguments
53
+ def api_v1_heat_pumps_get(self, search : Annotated[Optional[StrictStr], Field(description="String with keywords (split by spaces) to search on SN, PN and Name of a heat pump")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number")] = None, page_size : Annotated[Optional[StrictInt], Field(description="The page size")] = None, state : Annotated[Optional[DeviceState], Field(description="Filter for which device state the heat pump should be in using Device")] = 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[ReadAllHeatPumpDto]: # noqa: E501
54
+ """Gets all heat pumps (Paged, Searchable) # noqa: E501
55
+
56
+ This method makes a synchronous HTTP request by default. To make an
57
+ asynchronous HTTP request, please pass async_req=True
58
+
59
+ >>> thread = api.api_v1_heat_pumps_get(search, page, page_size, state, x_version, async_req=True)
60
+ >>> result = thread.get()
61
+
62
+ :param search: String with keywords (split by spaces) to search on SN, PN and Name of a heat pump
63
+ :type search: str
64
+ :param page: The page number
65
+ :type page: int
66
+ :param page_size: The page size
67
+ :type page_size: int
68
+ :param state: Filter for which device state the heat pump should be in using Device
69
+ :type state: DeviceState
70
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
71
+ :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.
78
+ :return: Returns the result object.
79
+ If the method is called asynchronously,
80
+ returns the request thread.
81
+ :rtype: List[ReadAllHeatPumpDto]
82
+ """
83
+ kwargs['_return_http_data_only'] = True
84
+ if '_preload_content' in kwargs:
85
+ message = "Error! Please call the api_v1_heat_pumps_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_get_with_http_info(search, page, page_size, state, x_version, **kwargs) # noqa: E501
88
+
89
+ @validate_arguments
90
+ def api_v1_heat_pumps_get_with_http_info(self, search : Annotated[Optional[StrictStr], Field(description="String with keywords (split by spaces) to search on SN, PN and Name of a heat pump")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number")] = None, page_size : Annotated[Optional[StrictInt], Field(description="The page size")] = None, state : Annotated[Optional[DeviceState], Field(description="Filter for which device state the heat pump should be in using Device")] = 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 all heat pumps (Paged, Searchable) # 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_get_with_http_info(search, page, page_size, state, x_version, async_req=True)
97
+ >>> result = thread.get()
98
+
99
+ :param search: String with keywords (split by spaces) to search on SN, PN and Name of a heat pump
100
+ :type search: str
101
+ :param page: The page number
102
+ :type page: int
103
+ :param page_size: The page size
104
+ :type page_size: int
105
+ :param state: Filter for which device state the heat pump should be in using Device
106
+ :type state: DeviceState
107
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
108
+ :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
+ :param _request_timeout: timeout setting for this request. If one
120
+ number provided, it will be total request
121
+ timeout. It can also be a pair (tuple) of
122
+ (connection, read) timeouts.
123
+ :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.
126
+ :type _request_auth: dict, optional
127
+ :type _content_type: string, optional: force content-type for the request
128
+ :return: Returns the result object.
129
+ If the method is called asynchronously,
130
+ returns the request thread.
131
+ :rtype: tuple(List[ReadAllHeatPumpDto], status_code(int), headers(HTTPHeaderDict))
132
+ """
133
+
134
+ _params = locals()
135
+
136
+ _all_params = [
137
+ 'search',
138
+ 'page',
139
+ 'page_size',
140
+ 'state',
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'
152
+ ]
153
+ )
154
+
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_get" % _key
161
+ )
162
+ _params[_key] = _val
163
+ del _params['kwargs']
164
+
165
+ _collection_formats = {}
166
+
167
+ # process the path parameters
168
+ _path_params = {}
169
+
170
+ # process the query parameters
171
+ _query_params = []
172
+ if _params.get('search') is not None: # noqa: E501
173
+ _query_params.append(('search', _params['search']))
174
+
175
+ if _params.get('page') is not None: # noqa: E501
176
+ _query_params.append(('page', _params['page']))
177
+
178
+ if _params.get('page_size') is not None: # noqa: E501
179
+ _query_params.append(('pageSize', _params['page_size']))
180
+
181
+ if _params.get('state') is not None: # noqa: E501
182
+ _query_params.append(('state', _params['state'].value))
183
+
184
+ # process the header parameters
185
+ _header_params = dict(_params.get('_headers', {}))
186
+ if _params['x_version'] is not None:
187
+ _header_params['x-version'] = _params['x_version']
188
+
189
+ # process the form parameters
190
+ _form_params = []
191
+ _files = {}
192
+ # process the body parameter
193
+ _body_params = None
194
+ # set the HTTP header `Accept`
195
+ _header_params['Accept'] = self.api_client.select_header_accept(
196
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
197
+
198
+ # authentication setting
199
+ _auth_settings = ['oauth2'] # noqa: E501
200
+
201
+ _response_types_map = {
202
+ '403': "str",
203
+ '505': None,
204
+ '200': "List[ReadAllHeatPumpDto]",
205
+ '500': None,
206
+ }
207
+
208
+ return self.api_client.call_api(
209
+ '/api/v1/heat-pumps', 'GET',
210
+ _path_params,
211
+ _query_params,
212
+ _header_params,
213
+ body=_body_params,
214
+ post_params=_form_params,
215
+ files=_files,
216
+ response_types_map=_response_types_map,
217
+ auth_settings=_auth_settings,
218
+ async_req=_params.get('async_req'),
219
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
220
+ _preload_content=_params.get('_preload_content', True),
221
+ _request_timeout=_params.get('_request_timeout'),
222
+ collection_formats=_collection_formats,
223
+ _request_auth=_params.get('_request_auth'))
224
+
225
+
226
+
227
+ @validate_arguments
228
+ def api_v1_heat_pumps_heat_pump_id_get(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The heatPumpId of the heat pump you want to get")], x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> ReadHeatPumpDto: # noqa: E501
229
+ """Gets a heat pump by heatPumpId # noqa: E501
230
+
231
+ This method makes a synchronous HTTP request by default. To make an
232
+ asynchronous HTTP request, please pass async_req=True
233
+
234
+ >>> thread = api.api_v1_heat_pumps_heat_pump_id_get(heat_pump_id, x_version, async_req=True)
235
+ >>> result = thread.get()
236
+
237
+ :param heat_pump_id: The heatPumpId of the heat pump you want to get (required)
238
+ :type heat_pump_id: str
239
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
240
+ :type x_version: str
241
+ :param async_req: Whether to execute the request asynchronously.
242
+ :type async_req: bool, optional
243
+ :param _request_timeout: timeout setting for this request.
244
+ If one number provided, it will be total request
245
+ timeout. It can also be a pair (tuple) of
246
+ (connection, read) timeouts.
247
+ :return: Returns the result object.
248
+ If the method is called asynchronously,
249
+ returns the request thread.
250
+ :rtype: ReadHeatPumpDto
251
+ """
252
+ kwargs['_return_http_data_only'] = True
253
+ if '_preload_content' in kwargs:
254
+ message = "Error! Please call the api_v1_heat_pumps_heat_pump_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
255
+ raise ValueError(message)
256
+ return self.api_v1_heat_pumps_heat_pump_id_get_with_http_info(heat_pump_id, x_version, **kwargs) # noqa: E501
257
+
258
+ @validate_arguments
259
+ def api_v1_heat_pumps_heat_pump_id_get_with_http_info(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The heatPumpId of the heat pump you want to get")], 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
260
+ """Gets a heat pump by heatPumpId # noqa: E501
261
+
262
+ This method makes a synchronous HTTP request by default. To make an
263
+ asynchronous HTTP request, please pass async_req=True
264
+
265
+ >>> thread = api.api_v1_heat_pumps_heat_pump_id_get_with_http_info(heat_pump_id, x_version, async_req=True)
266
+ >>> result = thread.get()
267
+
268
+ :param heat_pump_id: The heatPumpId of the heat pump you want to get (required)
269
+ :type heat_pump_id: str
270
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
271
+ :type x_version: str
272
+ :param async_req: Whether to execute the request asynchronously.
273
+ :type async_req: bool, optional
274
+ :param _preload_content: if False, the ApiResponse.data will
275
+ be set to none and raw_data will store the
276
+ HTTP response body without reading/decoding.
277
+ Default is True.
278
+ :type _preload_content: bool, optional
279
+ :param _return_http_data_only: response data instead of ApiResponse
280
+ object with status code, headers, etc
281
+ :type _return_http_data_only: bool, optional
282
+ :param _request_timeout: timeout setting for this request. If one
283
+ number provided, it will be total request
284
+ timeout. It can also be a pair (tuple) of
285
+ (connection, read) timeouts.
286
+ :param _request_auth: set to override the auth_settings for an a single
287
+ request; this effectively ignores the authentication
288
+ in the spec for a single request.
289
+ :type _request_auth: dict, optional
290
+ :type _content_type: string, optional: force content-type for the request
291
+ :return: Returns the result object.
292
+ If the method is called asynchronously,
293
+ returns the request thread.
294
+ :rtype: tuple(ReadHeatPumpDto, status_code(int), headers(HTTPHeaderDict))
295
+ """
296
+
297
+ _params = locals()
298
+
299
+ _all_params = [
300
+ 'heat_pump_id',
301
+ 'x_version'
302
+ ]
303
+ _all_params.extend(
304
+ [
305
+ 'async_req',
306
+ '_return_http_data_only',
307
+ '_preload_content',
308
+ '_request_timeout',
309
+ '_request_auth',
310
+ '_content_type',
311
+ '_headers'
312
+ ]
313
+ )
314
+
315
+ # validate the arguments
316
+ for _key, _val in _params['kwargs'].items():
317
+ if _key not in _all_params:
318
+ raise ApiTypeError(
319
+ "Got an unexpected keyword argument '%s'"
320
+ " to method api_v1_heat_pumps_heat_pump_id_get" % _key
321
+ )
322
+ _params[_key] = _val
323
+ del _params['kwargs']
324
+
325
+ _collection_formats = {}
326
+
327
+ # process the path parameters
328
+ _path_params = {}
329
+ if _params['heat_pump_id'] is not None:
330
+ _path_params['heatPumpId'] = _params['heat_pump_id']
331
+
332
+
333
+ # process the query parameters
334
+ _query_params = []
335
+ # process the header parameters
336
+ _header_params = dict(_params.get('_headers', {}))
337
+ if _params['x_version'] is not None:
338
+ _header_params['x-version'] = _params['x_version']
339
+
340
+ # process the form parameters
341
+ _form_params = []
342
+ _files = {}
343
+ # process the body parameter
344
+ _body_params = None
345
+ # set the HTTP header `Accept`
346
+ _header_params['Accept'] = self.api_client.select_header_accept(
347
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
348
+
349
+ # authentication setting
350
+ _auth_settings = ['oauth2'] # noqa: E501
351
+
352
+ _response_types_map = {
353
+ '403': "str",
354
+ '505': None,
355
+ '200': "ReadHeatPumpDto",
356
+ '404': None,
357
+ '500': None,
358
+ }
359
+
360
+ return self.api_client.call_api(
361
+ '/api/v1/heat-pumps/{heatPumpId}', 'GET',
362
+ _path_params,
363
+ _query_params,
364
+ _header_params,
365
+ body=_body_params,
366
+ post_params=_form_params,
367
+ files=_files,
368
+ response_types_map=_response_types_map,
369
+ auth_settings=_auth_settings,
370
+ async_req=_params.get('async_req'),
371
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
372
+ _preload_content=_params.get('_preload_content', True),
373
+ _request_timeout=_params.get('_request_timeout'),
374
+ collection_formats=_collection_formats,
375
+ _request_auth=_params.get('_request_auth'))
376
+
377
+
378
+
379
+
380
+
381
+
382
+ @validate_arguments
383
+ def api_v1_heat_pumps_sn_serial_number_get(self, serial_number : Annotated[StrictStr, Field(..., description="The serial number of the heat pump you want to get")], x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> ReadHeatPumpDto: # noqa: E501
384
+ """Gets a heat pump by Serial Number # noqa: E501
385
+
386
+ This method makes a synchronous HTTP request by default. To make an
387
+ asynchronous HTTP request, please pass async_req=True
388
+
389
+ >>> thread = api.api_v1_heat_pumps_sn_serial_number_get(serial_number, x_version, async_req=True)
390
+ >>> result = thread.get()
391
+
392
+ :param serial_number: The serial number of the heat pump you want to get (required)
393
+ :type serial_number: str
394
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
395
+ :type x_version: str
396
+ :param async_req: Whether to execute the request asynchronously.
397
+ :type async_req: bool, optional
398
+ :param _request_timeout: timeout setting for this request.
399
+ If one number provided, it will be total request
400
+ timeout. It can also be a pair (tuple) of
401
+ (connection, read) timeouts.
402
+ :return: Returns the result object.
403
+ If the method is called asynchronously,
404
+ returns the request thread.
405
+ :rtype: ReadHeatPumpDto
406
+ """
407
+ kwargs['_return_http_data_only'] = True
408
+ if '_preload_content' in kwargs:
409
+ message = "Error! Please call the api_v1_heat_pumps_sn_serial_number_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
410
+ raise ValueError(message)
411
+ return self.api_v1_heat_pumps_sn_serial_number_get_with_http_info(serial_number, x_version, **kwargs) # noqa: E501
412
+
413
+ @validate_arguments
414
+ def api_v1_heat_pumps_sn_serial_number_get_with_http_info(self, serial_number : Annotated[StrictStr, Field(..., description="The serial number of the heat pump you want to get")], 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
415
+ """Gets a heat pump by Serial Number # noqa: E501
416
+
417
+ This method makes a synchronous HTTP request by default. To make an
418
+ asynchronous HTTP request, please pass async_req=True
419
+
420
+ >>> thread = api.api_v1_heat_pumps_sn_serial_number_get_with_http_info(serial_number, x_version, async_req=True)
421
+ >>> result = thread.get()
422
+
423
+ :param serial_number: The serial number of the heat pump you want to get (required)
424
+ :type serial_number: str
425
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
426
+ :type x_version: str
427
+ :param async_req: Whether to execute the request asynchronously.
428
+ :type async_req: bool, optional
429
+ :param _preload_content: if False, the ApiResponse.data will
430
+ be set to none and raw_data will store the
431
+ HTTP response body without reading/decoding.
432
+ Default is True.
433
+ :type _preload_content: bool, optional
434
+ :param _return_http_data_only: response data instead of ApiResponse
435
+ object with status code, headers, etc
436
+ :type _return_http_data_only: bool, optional
437
+ :param _request_timeout: timeout setting for this request. If one
438
+ number provided, it will be total request
439
+ timeout. It can also be a pair (tuple) of
440
+ (connection, read) timeouts.
441
+ :param _request_auth: set to override the auth_settings for an a single
442
+ request; this effectively ignores the authentication
443
+ in the spec for a single request.
444
+ :type _request_auth: dict, optional
445
+ :type _content_type: string, optional: force content-type for the request
446
+ :return: Returns the result object.
447
+ If the method is called asynchronously,
448
+ returns the request thread.
449
+ :rtype: tuple(ReadHeatPumpDto, status_code(int), headers(HTTPHeaderDict))
450
+ """
451
+
452
+ _params = locals()
453
+
454
+ _all_params = [
455
+ 'serial_number',
456
+ 'x_version'
457
+ ]
458
+ _all_params.extend(
459
+ [
460
+ 'async_req',
461
+ '_return_http_data_only',
462
+ '_preload_content',
463
+ '_request_timeout',
464
+ '_request_auth',
465
+ '_content_type',
466
+ '_headers'
467
+ ]
468
+ )
469
+
470
+ # validate the arguments
471
+ for _key, _val in _params['kwargs'].items():
472
+ if _key not in _all_params:
473
+ raise ApiTypeError(
474
+ "Got an unexpected keyword argument '%s'"
475
+ " to method api_v1_heat_pumps_sn_serial_number_get" % _key
476
+ )
477
+ _params[_key] = _val
478
+ del _params['kwargs']
479
+
480
+ _collection_formats = {}
481
+
482
+ # process the path parameters
483
+ _path_params = {}
484
+ if _params['serial_number'] is not None:
485
+ _path_params['serialNumber'] = _params['serial_number']
486
+
487
+
488
+ # process the query parameters
489
+ _query_params = []
490
+ # process the header parameters
491
+ _header_params = dict(_params.get('_headers', {}))
492
+ if _params['x_version'] is not None:
493
+ _header_params['x-version'] = _params['x_version']
494
+
495
+ # process the form parameters
496
+ _form_params = []
497
+ _files = {}
498
+ # process the body parameter
499
+ _body_params = None
500
+ # set the HTTP header `Accept`
501
+ _header_params['Accept'] = self.api_client.select_header_accept(
502
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
503
+
504
+ # authentication setting
505
+ _auth_settings = ['oauth2'] # noqa: E501
506
+
507
+ _response_types_map = {
508
+ '403': "str",
509
+ '505': None,
510
+ '200': "ReadHeatPumpDto",
511
+ '404': None,
512
+ '500': None,
513
+ }
514
+
515
+ return self.api_client.call_api(
516
+ '/api/v1/heat-pumps/sn/{serialNumber}', 'GET',
517
+ _path_params,
518
+ _query_params,
519
+ _header_params,
520
+ body=_body_params,
521
+ post_params=_form_params,
522
+ files=_files,
523
+ response_types_map=_response_types_map,
524
+ auth_settings=_auth_settings,
525
+ async_req=_params.get('async_req'),
526
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
527
+ _preload_content=_params.get('_preload_content', True),
528
+ _request_timeout=_params.get('_request_timeout'),
529
+ collection_formats=_collection_formats,
530
+ _request_auth=_params.get('_request_auth'))
531
+
532
+