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.
- weheat/__init__.py +45 -0
- weheat/abstractions/__init__.py +3 -0
- weheat/abstractions/auth.py +34 -0
- weheat/abstractions/discovery.py +62 -0
- weheat/abstractions/heat_pump.py +273 -0
- weheat/abstractions/user.py +23 -0
- weheat/api/__init__.py +7 -0
- weheat/api/energy_log_api.py +230 -0
- weheat/api/heat_pump_api.py +532 -0
- weheat/api/heat_pump_log_api.py +554 -0
- weheat/api/user_api.py +193 -0
- weheat/api_client.py +766 -0
- weheat/api_response.py +29 -0
- weheat/configuration.py +442 -0
- weheat/exceptions.py +166 -0
- weheat/models/__init__.py +24 -0
- weheat/models/boiler_type.py +42 -0
- weheat/models/device_state.py +46 -0
- weheat/models/dhw_type.py +41 -0
- weheat/models/energy_view_dto.py +121 -0
- weheat/models/heat_pump_log_view_dto.py +771 -0
- weheat/models/heat_pump_model.py +44 -0
- weheat/models/heat_pump_status_enum.py +46 -0
- weheat/models/heat_pump_type.py +42 -0
- weheat/models/raw_heat_pump_log_dto.py +517 -0
- weheat/models/read_all_heat_pump_dto.py +124 -0
- weheat/models/read_heat_pump_dto.py +117 -0
- weheat/models/read_user_dto.py +102 -0
- weheat/models/role.py +46 -0
- weheat/py.typed +0 -0
- weheat/rest.py +327 -0
- weheat-2025.1.14rc1.dist-info/LICENSE +21 -0
- weheat-2025.1.14rc1.dist-info/METADATA +117 -0
- weheat-2025.1.14rc1.dist-info/RECORD +36 -0
- weheat-2025.1.14rc1.dist-info/WHEEL +5 -0
- weheat-2025.1.14rc1.dist-info/top_level.txt +1 -0
weheat/api/user_api.py
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
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, StrictStr
|
|
21
|
+
except ImportError:
|
|
22
|
+
from pydantic import validate_arguments, Field, StrictStr
|
|
23
|
+
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
|
|
26
|
+
from typing import Optional
|
|
27
|
+
|
|
28
|
+
from weheat.models.read_user_dto import ReadUserDto
|
|
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 UserApi:
|
|
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_users_me_get(self, x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> ReadUserDto: # noqa: E501
|
|
52
|
+
"""Me endpoint to verify everything is ok after login (also sets Name of user after registration) Please always call this after login so backend (and frontend) can verify everything is correct. # 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_users_me_get(x_version, async_req=True)
|
|
58
|
+
>>> result = thread.get()
|
|
59
|
+
|
|
60
|
+
:param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
|
|
61
|
+
:type x_version: str
|
|
62
|
+
:param async_req: Whether to execute the request asynchronously.
|
|
63
|
+
:type async_req: bool, optional
|
|
64
|
+
:param _request_timeout: timeout setting for this request.
|
|
65
|
+
If one number provided, it will be total request
|
|
66
|
+
timeout. It can also be a pair (tuple) of
|
|
67
|
+
(connection, read) timeouts.
|
|
68
|
+
:return: Returns the result object.
|
|
69
|
+
If the method is called asynchronously,
|
|
70
|
+
returns the request thread.
|
|
71
|
+
:rtype: ReadUserDto
|
|
72
|
+
"""
|
|
73
|
+
kwargs['_return_http_data_only'] = True
|
|
74
|
+
if '_preload_content' in kwargs:
|
|
75
|
+
message = "Error! Please call the api_v1_users_me_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
|
76
|
+
raise ValueError(message)
|
|
77
|
+
return self.api_v1_users_me_get_with_http_info(x_version, **kwargs) # noqa: E501
|
|
78
|
+
|
|
79
|
+
@validate_arguments
|
|
80
|
+
def api_v1_users_me_get_with_http_info(self, 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
|
|
81
|
+
"""Me endpoint to verify everything is ok after login (also sets Name of user after registration) Please always call this after login so backend (and frontend) can verify everything is correct. # noqa: E501
|
|
82
|
+
|
|
83
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
84
|
+
asynchronous HTTP request, please pass async_req=True
|
|
85
|
+
|
|
86
|
+
>>> thread = api.api_v1_users_me_get_with_http_info(x_version, async_req=True)
|
|
87
|
+
>>> result = thread.get()
|
|
88
|
+
|
|
89
|
+
:param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
|
|
90
|
+
:type x_version: str
|
|
91
|
+
:param async_req: Whether to execute the request asynchronously.
|
|
92
|
+
:type async_req: bool, optional
|
|
93
|
+
:param _preload_content: if False, the ApiResponse.data will
|
|
94
|
+
be set to none and raw_data will store the
|
|
95
|
+
HTTP response body without reading/decoding.
|
|
96
|
+
Default is True.
|
|
97
|
+
:type _preload_content: bool, optional
|
|
98
|
+
:param _return_http_data_only: response data instead of ApiResponse
|
|
99
|
+
object with status code, headers, etc
|
|
100
|
+
:type _return_http_data_only: bool, optional
|
|
101
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
102
|
+
number provided, it will be total request
|
|
103
|
+
timeout. It can also be a pair (tuple) of
|
|
104
|
+
(connection, read) timeouts.
|
|
105
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
106
|
+
request; this effectively ignores the authentication
|
|
107
|
+
in the spec for a single request.
|
|
108
|
+
:type _request_auth: dict, optional
|
|
109
|
+
:type _content_type: string, optional: force content-type for the request
|
|
110
|
+
:return: Returns the result object.
|
|
111
|
+
If the method is called asynchronously,
|
|
112
|
+
returns the request thread.
|
|
113
|
+
:rtype: tuple(ReadUserDto, status_code(int), headers(HTTPHeaderDict))
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
_params = locals()
|
|
117
|
+
|
|
118
|
+
_all_params = [
|
|
119
|
+
'x_version'
|
|
120
|
+
]
|
|
121
|
+
_all_params.extend(
|
|
122
|
+
[
|
|
123
|
+
'async_req',
|
|
124
|
+
'_return_http_data_only',
|
|
125
|
+
'_preload_content',
|
|
126
|
+
'_request_timeout',
|
|
127
|
+
'_request_auth',
|
|
128
|
+
'_content_type',
|
|
129
|
+
'_headers'
|
|
130
|
+
]
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# validate the arguments
|
|
134
|
+
for _key, _val in _params['kwargs'].items():
|
|
135
|
+
if _key not in _all_params:
|
|
136
|
+
raise ApiTypeError(
|
|
137
|
+
"Got an unexpected keyword argument '%s'"
|
|
138
|
+
" to method api_v1_users_me_get" % _key
|
|
139
|
+
)
|
|
140
|
+
_params[_key] = _val
|
|
141
|
+
del _params['kwargs']
|
|
142
|
+
|
|
143
|
+
_collection_formats = {}
|
|
144
|
+
|
|
145
|
+
# process the path parameters
|
|
146
|
+
_path_params = {}
|
|
147
|
+
|
|
148
|
+
# process the query parameters
|
|
149
|
+
_query_params = []
|
|
150
|
+
# process the header parameters
|
|
151
|
+
_header_params = dict(_params.get('_headers', {}))
|
|
152
|
+
if _params['x_version'] is not None:
|
|
153
|
+
_header_params['x-version'] = _params['x_version']
|
|
154
|
+
|
|
155
|
+
# process the form parameters
|
|
156
|
+
_form_params = []
|
|
157
|
+
_files = {}
|
|
158
|
+
# process the body parameter
|
|
159
|
+
_body_params = None
|
|
160
|
+
# set the HTTP header `Accept`
|
|
161
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
162
|
+
['text/plain', 'application/json', 'text/json']) # noqa: E501
|
|
163
|
+
|
|
164
|
+
# authentication setting
|
|
165
|
+
_auth_settings = ['oauth2'] # noqa: E501
|
|
166
|
+
|
|
167
|
+
_response_types_map = {
|
|
168
|
+
'403': "str",
|
|
169
|
+
'505': None,
|
|
170
|
+
'200': "ReadUserDto",
|
|
171
|
+
'400': None,
|
|
172
|
+
'404': None,
|
|
173
|
+
'409': None,
|
|
174
|
+
'500': None,
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return self.api_client.call_api(
|
|
178
|
+
'/api/v1/users/me', 'GET',
|
|
179
|
+
_path_params,
|
|
180
|
+
_query_params,
|
|
181
|
+
_header_params,
|
|
182
|
+
body=_body_params,
|
|
183
|
+
post_params=_form_params,
|
|
184
|
+
files=_files,
|
|
185
|
+
response_types_map=_response_types_map,
|
|
186
|
+
auth_settings=_auth_settings,
|
|
187
|
+
async_req=_params.get('async_req'),
|
|
188
|
+
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
|
189
|
+
_preload_content=_params.get('_preload_content', True),
|
|
190
|
+
_request_timeout=_params.get('_request_timeout'),
|
|
191
|
+
collection_formats=_collection_formats,
|
|
192
|
+
_request_auth=_params.get('_request_auth'))
|
|
193
|
+
|