b24api 0.3.4__tar.gz → 0.3.5__tar.gz
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.
- {b24api-0.3.4/b24api.egg-info → b24api-0.3.5}/PKG-INFO +1 -1
- {b24api-0.3.4 → b24api-0.3.5}/b24api/entity.py +11 -2
- {b24api-0.3.4 → b24api-0.3.5/b24api.egg-info}/PKG-INFO +1 -1
- {b24api-0.3.4 → b24api-0.3.5}/pyproject.toml +1 -1
- {b24api-0.3.4 → b24api-0.3.5}/LICENSE +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/MANIFEST.in +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/README.md +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api/__init__.py +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api/api.py +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api/error.py +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api/query.py +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api/settings.py +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api/transport.py +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api/type.py +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api.egg-info/SOURCES.txt +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api.egg-info/dependency_links.txt +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api.egg-info/requires.txt +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/b24api.egg-info/top_level.txt +0 -0
- {b24api-0.3.4 → b24api-0.3.5}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from typing import Annotated, Any, Self
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel, BeforeValidator,
|
|
4
|
+
from pydantic import BaseModel, BeforeValidator, field_validator
|
|
5
5
|
|
|
6
6
|
from b24api.error import ApiResponseError, RetryApiResponseError
|
|
7
7
|
from b24api.query import build_query
|
|
@@ -45,9 +45,18 @@ class ListRequest(Request):
|
|
|
45
45
|
class ErrorResponse(BaseModel):
|
|
46
46
|
"""API error response."""
|
|
47
47
|
|
|
48
|
-
error:
|
|
48
|
+
error: str | int
|
|
49
49
|
error_description: str
|
|
50
50
|
|
|
51
|
+
@field_validator("error")
|
|
52
|
+
@classmethod
|
|
53
|
+
def error_to_lower_str(cls, value: Any) -> Any: # noqa: ANN401
|
|
54
|
+
if not isinstance(value, int):
|
|
55
|
+
value = str(value)
|
|
56
|
+
if isinstance(value, str):
|
|
57
|
+
value = value.lower()
|
|
58
|
+
return value
|
|
59
|
+
|
|
51
60
|
def raise_error(self, retry_errors: list[str]) -> Self:
|
|
52
61
|
if self.error in retry_errors:
|
|
53
62
|
raise RetryApiResponseError(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|