weheat 2024.8.30__py3-none-any.whl → 2024.9.4rc1__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 CHANGED
@@ -20,6 +20,7 @@ __version__ = "2024.07.08"
20
20
  from weheat.api.energy_log_api import EnergyLogApi
21
21
  from weheat.api.heat_pump_api import HeatPumpApi
22
22
  from weheat.api.heat_pump_log_api import HeatPumpLogApi
23
+ from weheat.api.user_api import UserApi
23
24
 
24
25
  # import ApiClient
25
26
  from weheat.api_response import ApiResponse
@@ -39,4 +40,6 @@ from weheat.models.heat_pump_log_view_dto import HeatPumpLogViewDto
39
40
  from weheat.models.raw_heat_pump_log_dto import RawHeatPumpLogDto
40
41
  from weheat.models.read_all_heat_pump_dto import ReadAllHeatPumpDto
41
42
  from weheat.models.read_heat_pump_dto import ReadHeatPumpDto
43
+ from weheat.models.read_user_dto import ReadUserDto
44
+ from weheat.models.role import Role
42
45
 
weheat/api/__init__.py CHANGED
@@ -4,3 +4,4 @@
4
4
  from weheat.api.energy_log_api import EnergyLogApi
5
5
  from weheat.api.heat_pump_api import HeatPumpApi
6
6
  from weheat.api.heat_pump_log_api import HeatPumpLogApi
7
+ from weheat.api.user_api import UserApi
weheat/api/user_api.py ADDED
@@ -0,0 +1,191 @@
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, StrictStr
23
+
24
+ from typing import Optional
25
+
26
+ from weheat.models.read_user_dto import ReadUserDto
27
+
28
+ from weheat.api_client import ApiClient
29
+ from weheat.api_response import ApiResponse
30
+ from weheat.exceptions import ( # noqa: F401
31
+ ApiTypeError,
32
+ ApiValueError
33
+ )
34
+
35
+
36
+ class UserApi:
37
+ """NOTE: This class is auto generated by OpenAPI Generator
38
+ Ref: https://openapi-generator.tech
39
+
40
+ Do not edit the class manually.
41
+ """
42
+
43
+ def __init__(self, api_client=None) -> None:
44
+ if api_client is None:
45
+ api_client = ApiClient.get_default()
46
+ self.api_client = api_client
47
+
48
+ @validate_arguments
49
+ 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
50
+ """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
51
+
52
+ This method makes a synchronous HTTP request by default. To make an
53
+ asynchronous HTTP request, please pass async_req=True
54
+
55
+ >>> thread = api.api_v1_users_me_get(x_version, async_req=True)
56
+ >>> result = thread.get()
57
+
58
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
59
+ :type x_version: str
60
+ :param async_req: Whether to execute the request asynchronously.
61
+ :type async_req: bool, optional
62
+ :param _request_timeout: timeout setting for this request.
63
+ If one number provided, it will be total request
64
+ timeout. It can also be a pair (tuple) of
65
+ (connection, read) timeouts.
66
+ :return: Returns the result object.
67
+ If the method is called asynchronously,
68
+ returns the request thread.
69
+ :rtype: ReadUserDto
70
+ """
71
+ kwargs['_return_http_data_only'] = True
72
+ if '_preload_content' in kwargs:
73
+ 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
74
+ raise ValueError(message)
75
+ return self.api_v1_users_me_get_with_http_info(x_version, **kwargs) # noqa: E501
76
+
77
+ @validate_arguments
78
+ 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
79
+ """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
80
+
81
+ This method makes a synchronous HTTP request by default. To make an
82
+ asynchronous HTTP request, please pass async_req=True
83
+
84
+ >>> thread = api.api_v1_users_me_get_with_http_info(x_version, async_req=True)
85
+ >>> result = thread.get()
86
+
87
+ :param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
88
+ :type x_version: str
89
+ :param async_req: Whether to execute the request asynchronously.
90
+ :type async_req: bool, optional
91
+ :param _preload_content: if False, the ApiResponse.data will
92
+ be set to none and raw_data will store the
93
+ HTTP response body without reading/decoding.
94
+ Default is True.
95
+ :type _preload_content: bool, optional
96
+ :param _return_http_data_only: response data instead of ApiResponse
97
+ object with status code, headers, etc
98
+ :type _return_http_data_only: bool, optional
99
+ :param _request_timeout: timeout setting for this request. If one
100
+ number provided, it will be total request
101
+ timeout. It can also be a pair (tuple) of
102
+ (connection, read) timeouts.
103
+ :param _request_auth: set to override the auth_settings for an a single
104
+ request; this effectively ignores the authentication
105
+ in the spec for a single request.
106
+ :type _request_auth: dict, optional
107
+ :type _content_type: string, optional: force content-type for the request
108
+ :return: Returns the result object.
109
+ If the method is called asynchronously,
110
+ returns the request thread.
111
+ :rtype: tuple(ReadUserDto, status_code(int), headers(HTTPHeaderDict))
112
+ """
113
+
114
+ _params = locals()
115
+
116
+ _all_params = [
117
+ 'x_version'
118
+ ]
119
+ _all_params.extend(
120
+ [
121
+ 'async_req',
122
+ '_return_http_data_only',
123
+ '_preload_content',
124
+ '_request_timeout',
125
+ '_request_auth',
126
+ '_content_type',
127
+ '_headers'
128
+ ]
129
+ )
130
+
131
+ # validate the arguments
132
+ for _key, _val in _params['kwargs'].items():
133
+ if _key not in _all_params:
134
+ raise ApiTypeError(
135
+ "Got an unexpected keyword argument '%s'"
136
+ " to method api_v1_users_me_get" % _key
137
+ )
138
+ _params[_key] = _val
139
+ del _params['kwargs']
140
+
141
+ _collection_formats = {}
142
+
143
+ # process the path parameters
144
+ _path_params = {}
145
+
146
+ # process the query parameters
147
+ _query_params = []
148
+ # process the header parameters
149
+ _header_params = dict(_params.get('_headers', {}))
150
+ if _params['x_version'] is not None:
151
+ _header_params['x-version'] = _params['x_version']
152
+
153
+ # process the form parameters
154
+ _form_params = []
155
+ _files = {}
156
+ # process the body parameter
157
+ _body_params = None
158
+ # set the HTTP header `Accept`
159
+ _header_params['Accept'] = self.api_client.select_header_accept(
160
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
161
+
162
+ # authentication setting
163
+ _auth_settings = ['oauth2'] # noqa: E501
164
+
165
+ _response_types_map = {
166
+ '403': "str",
167
+ '505': None,
168
+ '200': "ReadUserDto",
169
+ '400': None,
170
+ '404': None,
171
+ '409': None,
172
+ '500': None,
173
+ }
174
+
175
+ return self.api_client.call_api(
176
+ '/api/v1/users/me', 'GET',
177
+ _path_params,
178
+ _query_params,
179
+ _header_params,
180
+ body=_body_params,
181
+ post_params=_form_params,
182
+ files=_files,
183
+ response_types_map=_response_types_map,
184
+ auth_settings=_auth_settings,
185
+ async_req=_params.get('async_req'),
186
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
187
+ _preload_content=_params.get('_preload_content', True),
188
+ _request_timeout=_params.get('_request_timeout'),
189
+ collection_formats=_collection_formats,
190
+ _request_auth=_params.get('_request_auth'))
191
+
weheat/models/__init__.py CHANGED
@@ -20,3 +20,5 @@ from weheat.models.heat_pump_log_view_dto import HeatPumpLogViewDto
20
20
  from weheat.models.raw_heat_pump_log_dto import RawHeatPumpLogDto
21
21
  from weheat.models.read_all_heat_pump_dto import ReadAllHeatPumpDto
22
22
  from weheat.models.read_heat_pump_dto import ReadHeatPumpDto
23
+ from weheat.models.read_user_dto import ReadUserDto
24
+ from weheat.models.role import Role
@@ -0,0 +1,99 @@
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
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from typing import Optional
22
+ from pydantic import BaseModel, Field, StrictStr
23
+ from weheat.models.role import Role
24
+
25
+ class ReadUserDto(BaseModel):
26
+ """
27
+ ReadUserDto
28
+ """
29
+ id: StrictStr = Field(..., description="Identifier of the user")
30
+ first_name: Optional[StrictStr] = Field(None, alias="firstName", description="First name of the user if available")
31
+ last_name: Optional[StrictStr] = Field(None, alias="lastName", description="Last Name of the user if available")
32
+ role: Role = Field(...)
33
+ email: Optional[StrictStr] = Field(None, description="Email address of the user")
34
+ updated_on: datetime = Field(..., alias="updatedOn", description="Timestamp of the last update to the user entry")
35
+ created_on: datetime = Field(..., alias="createdOn", description="Timestamp of the creation of the user entry")
36
+ __properties = ["id", "firstName", "lastName", "role", "email", "updatedOn", "createdOn"]
37
+
38
+ class Config:
39
+ """Pydantic configuration"""
40
+ allow_population_by_field_name = True
41
+ validate_assignment = True
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.dict(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> ReadUserDto:
53
+ """Create an instance of ReadUserDto from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self):
57
+ """Returns the dictionary representation of the model using alias"""
58
+ _dict = self.dict(by_alias=True,
59
+ exclude={
60
+ },
61
+ exclude_none=True)
62
+ # set to None if first_name (nullable) is None
63
+ # and __fields_set__ contains the field
64
+ if self.first_name is None and "first_name" in self.__fields_set__:
65
+ _dict['firstName'] = None
66
+
67
+ # set to None if last_name (nullable) is None
68
+ # and __fields_set__ contains the field
69
+ if self.last_name is None and "last_name" in self.__fields_set__:
70
+ _dict['lastName'] = None
71
+
72
+ # set to None if email (nullable) is None
73
+ # and __fields_set__ contains the field
74
+ if self.email is None and "email" in self.__fields_set__:
75
+ _dict['email'] = None
76
+
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: dict) -> ReadUserDto:
81
+ """Create an instance of ReadUserDto from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return ReadUserDto.parse_obj(obj)
87
+
88
+ _obj = ReadUserDto.parse_obj({
89
+ "id": obj.get("id"),
90
+ "first_name": obj.get("firstName"),
91
+ "last_name": obj.get("lastName"),
92
+ "role": obj.get("role"),
93
+ "email": obj.get("email"),
94
+ "updated_on": obj.get("updatedOn"),
95
+ "created_on": obj.get("createdOn")
96
+ })
97
+ return _obj
98
+
99
+
weheat/models/role.py ADDED
@@ -0,0 +1,46 @@
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 json
16
+ import pprint
17
+ import re # noqa: F401
18
+ from aenum import Enum, no_arg
19
+
20
+
21
+
22
+
23
+
24
+ class Role(int, Enum):
25
+ """
26
+ Roles that can be assigned to a user.\\ Roles enumeration include: - Admin (0), - Support (1), - Logistics (2), - Sales (3), - DataScientist (4), - Production (5), - Installer (6), - Consumer (7)
27
+ """
28
+
29
+ """
30
+ allowed enum values
31
+ """
32
+ NUMBER_0 = 0
33
+ NUMBER_1 = 1
34
+ NUMBER_2 = 2
35
+ NUMBER_3 = 3
36
+ NUMBER_4 = 4
37
+ NUMBER_5 = 5
38
+ NUMBER_6 = 6
39
+ NUMBER_7 = 7
40
+
41
+ @classmethod
42
+ def from_json(cls, json_str: str) -> Role:
43
+ """Create an instance of Role from a JSON string"""
44
+ return Role(json.loads(json_str))
45
+
46
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: weheat
3
- Version: 2024.8.30
3
+ Version: 2024.9.4rc1
4
4
  Summary: Weheat Backend client
5
5
  Home-page: https://github.com/wefabricate/wh-python
6
6
  Author: Jesper Raemaekers
@@ -1,4 +1,4 @@
1
- weheat/__init__.py,sha256=vZpdNWQdQDpleRSGL1Y9e90lgROA_Eh0IWEsp8rZlYU,1312
1
+ weheat/__init__.py,sha256=dk7tMBQ9jtkNiWeZW5xWCJoaGIrZVQ-tm5NCZhi2qWU,1440
2
2
  weheat/api_client.py,sha256=QNUo_W5MMBajpjN2sWFUIRhOszAE93KECNxdvhVns84,29516
3
3
  weheat/api_response.py,sha256=uCehWdXXDnAO2HAHGKe0SgpQ_mJiGDbcu-BHDF3n_IM,852
4
4
  weheat/configuration.py,sha256=FerGmYva4hSzbtPV8hASrSF4Fd1zRIFezPzBhHQHV5c,14562
@@ -9,11 +9,12 @@ weheat/abstractions/__init__.py,sha256=cRdA_kyTIooo39I13_mqShSfZMqdzNGHbmrnITqgx
9
9
  weheat/abstractions/auth.py,sha256=VCAxJ4OIj7bsYttqJl5-juU0VUlSd3xPu7kUjtHZr3U,979
10
10
  weheat/abstractions/discovery.py,sha256=0HEXdtIuw3FIATUwX0xpeUVRnk8i-HRL21pE6b1mej0,1679
11
11
  weheat/abstractions/heat_pump.py,sha256=kzi6B6oQ8hFYzxMBZqVwbFRY16vR9OFnlWPErBQ_8uA,4649
12
- weheat/api/__init__.py,sha256=CNY0PYXwKCKT9xlI0z574W6dMOAqQMjiZHuubLdleX8,203
12
+ weheat/api/__init__.py,sha256=DQnnRs5Z29Nf5sGdFd3f96xM6p_FMym-_-dvQC2VzdU,243
13
13
  weheat/api/energy_log_api.py,sha256=yIIqd-C_xHSM_1eNoj2i04IDkJkzU0-a9iFGDSd2zLo,11374
14
14
  weheat/api/heat_pump_api.py,sha256=FAf7jxosIAginCom-aUuFdj7jZupv8134OI6rpkdK80,24368
15
15
  weheat/api/heat_pump_log_api.py,sha256=Xt4pkXOT1x7dsJse00iXpCMQTDuLzhQrMgL_XK3DzDo,28602
16
- weheat/models/__init__.py,sha256=OrBvAJHJbH4ui9BGo6-v0Wdgi-gkdnqp4bRnaE0vnoI,678
16
+ weheat/api/user_api.py,sha256=OHRj6Pur5oLxmC4lkcU-pl2o-XWFhasJbMvoXSrDqqg,7766
17
+ weheat/models/__init__.py,sha256=VJsiySw4ndbqm5WCTxehHg-gmjaB_m2czi2FO-AQZn0,766
17
18
  weheat/models/boiler_type.py,sha256=jZF4sXhR7SEhj3bEfvmeH48l1APu_gtSlpQUj45vP7o,906
18
19
  weheat/models/device_state.py,sha256=Di_i-8IOWQaK25eYGNsgXv1OZh9s8RAH-6vcdacAObo,1035
19
20
  weheat/models/dhw_type.py,sha256=IamPcF02M_BDadVxfD7poh1C00mPXTJ9Wbjwh6TUfV8,817
@@ -25,8 +26,10 @@ weheat/models/heat_pump_type.py,sha256=Kft4cXvenK27miFDcsBOHv7p2svAW18iptT_GUcXW
25
26
  weheat/models/raw_heat_pump_log_dto.py,sha256=vNn1u8_jYAIV9miBK3Qvq0j-U5OYv56dRU2085fLvcI,34385
26
27
  weheat/models/read_all_heat_pump_dto.py,sha256=PDaWb-2qSzAnMoIsNceHavT1ybIZa3-lva3zJZA2BzU,5088
27
28
  weheat/models/read_heat_pump_dto.py,sha256=ufDbcHxtB8o2jmk00bMP_xol3uCdoTOqiHS6UUzRic4,4514
28
- weheat-2024.8.30.dist-info/LICENSE,sha256=rWmFUq0uth2jpet-RQ2QPd2VhZkcPSUs6Dxfmbqkbis,1068
29
- weheat-2024.8.30.dist-info/METADATA,sha256=VA2tPnSBiukql97GDR0xS-c-P0pz4e8cI6laUZYWCVk,3901
30
- weheat-2024.8.30.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
31
- weheat-2024.8.30.dist-info/top_level.txt,sha256=hLzdyvGZ9rs4AqK7U48mdHx_-FcP5sDuTSleDUvGAZw,7
32
- weheat-2024.8.30.dist-info/RECORD,,
29
+ weheat/models/read_user_dto.py,sha256=J1YlL-WsXArbirllI1fHZrguKy5Wv35NIck59ICBSGg,3465
30
+ weheat/models/role.py,sha256=eF6nawkz8mmCGQEmJx26Y2MPFmlKdpOOtJ2Q70b-Qtc,938
31
+ weheat-2024.9.4rc1.dist-info/LICENSE,sha256=rWmFUq0uth2jpet-RQ2QPd2VhZkcPSUs6Dxfmbqkbis,1068
32
+ weheat-2024.9.4rc1.dist-info/METADATA,sha256=k8icKT87_OtUV9nGLGX1_Mso9VLtejB3qxsA0YbfAbs,3903
33
+ weheat-2024.9.4rc1.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
34
+ weheat-2024.9.4rc1.dist-info/top_level.txt,sha256=hLzdyvGZ9rs4AqK7U48mdHx_-FcP5sDuTSleDUvGAZw,7
35
+ weheat-2024.9.4rc1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (74.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5