-
Notifications
You must be signed in to change notification settings - Fork 16
/
fixes.diff
26 lines (23 loc) · 1.13 KB
/
fixes.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/src/pieces_os_client/api_client.py b/src/pieces_os_client/api_client.py
index c03f2e5..7d084ea 100644
--- a/src/pieces_os_client/api_client.py
+++ b/src/pieces_os_client/api_client.py
@@ -27,7 +27,7 @@ from urllib.parse import quote
from pieces_os_client.configuration import Configuration
from pieces_os_client.api_response import ApiResponse
-import pieces_os_client.models
+import importlib
from pieces_os_client import rest
from pieces_os_client.exceptions import ApiValueError, ApiException
@@ -345,7 +345,11 @@ class ApiClient:
if klass in self.NATIVE_TYPES_MAPPING:
klass = self.NATIVE_TYPES_MAPPING[klass]
else:
- klass = getattr(pieces_os_client.models, klass)
+ # Convert the class to snake case
+ snake_case = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()
+ # Import the class
+ module = importlib.import_module(f"pieces_os_client.models.{snake_case}")
+ klass = getattr(module, klass)
if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass)