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