maleo-schemas 0.0.2__py3-none-any.whl → 0.0.4__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.
- maleo/schemas/operation/base.py +2 -2
- maleo/schemas/response.py +29 -3
- {maleo_schemas-0.0.2.dist-info → maleo_schemas-0.0.4.dist-info}/METADATA +1 -1
- {maleo_schemas-0.0.2.dist-info → maleo_schemas-0.0.4.dist-info}/RECORD +7 -7
- {maleo_schemas-0.0.2.dist-info → maleo_schemas-0.0.4.dist-info}/WHEEL +0 -0
- {maleo_schemas-0.0.2.dist-info → maleo_schemas-0.0.4.dist-info}/licenses/LICENSE +0 -0
- {maleo_schemas-0.0.2.dist-info → maleo_schemas-0.0.4.dist-info}/top_level.txt +0 -0
maleo/schemas/operation/base.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import traceback
|
2
|
+
from logging import Logger
|
2
3
|
from typing import Generic, Literal
|
3
4
|
from maleo.logging.enums import Level
|
4
|
-
from maleo.logging.logger import Base
|
5
5
|
from maleo.mixins.general import Success, SuccessT
|
6
6
|
from maleo.mixins.operation import (
|
7
7
|
OperationIdentifier,
|
@@ -155,7 +155,7 @@ class BaseOperation(
|
|
155
155
|
|
156
156
|
def log(
|
157
157
|
self,
|
158
|
-
logger:
|
158
|
+
logger: Logger,
|
159
159
|
level: Level,
|
160
160
|
*,
|
161
161
|
exc_info: OptionalBoolean = None,
|
maleo/schemas/response.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
from pydantic import BaseModel, Field
|
2
|
-
from typing import Dict, Generic, List, Literal, Optional, TypeVar, Union
|
2
|
+
from typing import Dict, Generic, List, Literal, Optional, Type, TypeVar, Union
|
3
3
|
from maleo.dtos.data import DataPair, GenericDataT, DataT
|
4
4
|
from maleo.dtos.descriptor import (
|
5
5
|
ErrorDescriptor,
|
@@ -54,7 +54,6 @@ from maleo.enums.error import Code as ErrorCode
|
|
54
54
|
from maleo.enums.success import Code as SuccessCode
|
55
55
|
from maleo.mixins.general import SuccessT, Success, CodeT, Descriptor
|
56
56
|
from maleo.types.base.any import OptionalAny
|
57
|
-
from maleo.types.base.dict import StringToAnyDict
|
58
57
|
|
59
58
|
|
60
59
|
class Response(
|
@@ -181,7 +180,34 @@ class ServiceUnavailableResponse(
|
|
181
180
|
pass
|
182
181
|
|
183
182
|
|
184
|
-
|
183
|
+
ERROR_RESPONSE_MAP: Dict[ErrorCode, Type[ErrorResponse]] = {
|
184
|
+
ErrorCode.BAD_REQUEST: BadRequestResponse,
|
185
|
+
ErrorCode.UNAUTHORIZED: UnauthorizedResponse,
|
186
|
+
ErrorCode.FORBIDDEN: ForbiddenResponse,
|
187
|
+
ErrorCode.NOT_FOUND: NotFoundResponse,
|
188
|
+
ErrorCode.METHOD_NOT_ALLOWED: MethodNotAllowedResponse,
|
189
|
+
ErrorCode.CONFLICT: ConflictResponse,
|
190
|
+
ErrorCode.UNPROCESSABLE_ENTITY: UnprocessableEntityResponse,
|
191
|
+
ErrorCode.TOO_MANY_REQUESTS: TooManyRequestsResponse,
|
192
|
+
ErrorCode.INTERNAL_SERVER_ERROR: InternalServerErrorResponse,
|
193
|
+
ErrorCode.DATABASE_ERROR: DatabaseErrorResponse,
|
194
|
+
ErrorCode.NOT_IMPLEMENTED: NotImplementedResponse,
|
195
|
+
ErrorCode.BAD_GATEWAY: BadGatewayResponse,
|
196
|
+
ErrorCode.SERVICE_UNAVAILABLE: ServiceUnavailableResponse,
|
197
|
+
}
|
198
|
+
|
199
|
+
|
200
|
+
OTHER_RESPONSES: Dict[
|
201
|
+
Union[int, str],
|
202
|
+
Dict[
|
203
|
+
str,
|
204
|
+
Union[
|
205
|
+
str,
|
206
|
+
Type[ErrorResponse],
|
207
|
+
List[Type[ErrorResponse]],
|
208
|
+
],
|
209
|
+
],
|
210
|
+
] = {
|
185
211
|
400: {
|
186
212
|
"description": "Bad Request Response",
|
187
213
|
"model": BadRequestResponse,
|
@@ -1,14 +1,14 @@
|
|
1
1
|
maleo/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
maleo/schemas/request.py,sha256=1tFUZyr6kofpNHVM5h1Qx9TCHt4EqS_hfIZlADuaUI0,733
|
3
|
-
maleo/schemas/response.py,sha256=
|
3
|
+
maleo/schemas/response.py,sha256=WnyeRxaFoGK-wj_SAyY-xMC1Hm7NjIb3J4JC-u8w2-I,9916
|
4
4
|
maleo/schemas/operation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
maleo/schemas/operation/action.py,sha256=LjR7KQBpB_oA64iFT4WGvnA0IrwXW4v0sI35o3vlY5Y,293
|
6
|
-
maleo/schemas/operation/base.py,sha256=
|
6
|
+
maleo/schemas/operation/base.py,sha256=yW9UUEevwEmKc-DktYmrXgBzWVksSMCOzMWeAzEDtww,7262
|
7
7
|
maleo/schemas/operation/request.py,sha256=t_bTGcihjmg9a2BBP2f5q6--ed6WA4jjI1WRIxSp_Ds,3225
|
8
8
|
maleo/schemas/operation/resource.py,sha256=wf1bDa97O0W9-QXjKXrkqFqeHTQuWV_RWc2vMLhRDvI,27771
|
9
9
|
maleo/schemas/operation/system.py,sha256=nZgRwp2cc6DLqpl8-notwJjZTkedfBa_72sY_HbcBk4,1865
|
10
|
-
maleo_schemas-0.0.
|
11
|
-
maleo_schemas-0.0.
|
12
|
-
maleo_schemas-0.0.
|
13
|
-
maleo_schemas-0.0.
|
14
|
-
maleo_schemas-0.0.
|
10
|
+
maleo_schemas-0.0.4.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
11
|
+
maleo_schemas-0.0.4.dist-info/METADATA,sha256=_CwLzoSuB619xKqNqixxftcENvt5bFLU68qrGWGnP_k,3357
|
12
|
+
maleo_schemas-0.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
13
|
+
maleo_schemas-0.0.4.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
14
|
+
maleo_schemas-0.0.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|