pydiagral 1.0.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pydiagral/__init__.py +28 -0
- pydiagral/api.py +1249 -0
- pydiagral/constants.py +4 -0
- pydiagral/exceptions.py +39 -0
- pydiagral/models.py +1498 -0
- pydiagral/utils.py +14 -0
- pydiagral-1.0.0.dist-info/METADATA +828 -0
- pydiagral-1.0.0.dist-info/RECORD +10 -0
- pydiagral-1.0.0.dist-info/WHEEL +4 -0
- pydiagral-1.0.0.dist-info/licenses/LICENSE +674 -0
pydiagral/constants.py
ADDED
pydiagral/exceptions.py
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
"""Module defining custom exceptions for the Diagral API."""
|
2
|
+
|
3
|
+
|
4
|
+
class DiagralAPIError(Exception):
|
5
|
+
"""Base exception for Diagral API errors."""
|
6
|
+
|
7
|
+
def __init__(self, message: str, status_code: int | None = None) -> None:
|
8
|
+
"""Initialize the DiagralAPIError.
|
9
|
+
|
10
|
+
:param message: The error message.
|
11
|
+
:param status_code: The status code of the error, if any.
|
12
|
+
"""
|
13
|
+
self.message = message
|
14
|
+
self.status_code = status_code
|
15
|
+
super().__init__(self.message)
|
16
|
+
|
17
|
+
|
18
|
+
class ConfigurationError(DiagralAPIError):
|
19
|
+
"""Raised when configuration is invalid."""
|
20
|
+
|
21
|
+
|
22
|
+
class SessionError(DiagralAPIError):
|
23
|
+
"""Raised when session is invalid."""
|
24
|
+
|
25
|
+
|
26
|
+
class AuthenticationError(DiagralAPIError):
|
27
|
+
"""Raised when authentication fails."""
|
28
|
+
|
29
|
+
|
30
|
+
class ValidationError(DiagralAPIError):
|
31
|
+
"""Raised when validation fails."""
|
32
|
+
|
33
|
+
|
34
|
+
class ServerError(DiagralAPIError):
|
35
|
+
"""Raised when server returns 5xx error."""
|
36
|
+
|
37
|
+
|
38
|
+
class ClientError(DiagralAPIError):
|
39
|
+
"""Raised when client returns error."""
|