maleo-foundation 0.2.35__py3-none-any.whl → 0.2.38__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.
@@ -50,6 +50,11 @@ class BaseResponses:
50
50
  message:str = "Unexpected Server Error"
51
51
  description:str = "An unexpected error occurred while processing your request."
52
52
 
53
+ class NotImplemented(Fail):
54
+ code:str = "MAL-NIM-001"
55
+ message:str = "Not Implemented"
56
+ description:str = "This request is not yet implemented by the system."
57
+
53
58
  class NotFound(BaseResultSchemas.NotFound): pass
54
59
 
55
60
  class NoData(BaseResultSchemas.NoData): pass
@@ -120,5 +125,9 @@ class BaseResponses:
120
125
  status.HTTP_500_INTERNAL_SERVER_ERROR: {
121
126
  "description": "Internal Server Error Response",
122
127
  "model": ServerError
128
+ },
129
+ status.HTTP_501_NOT_IMPLEMENTED: {
130
+ "description": "Not Implemented Response",
131
+ "model": ServerError
123
132
  }
124
133
  }
@@ -0,0 +1,59 @@
1
+ from fastapi import status
2
+ from maleo_foundation.models.transfers.results.service.controllers.rest \
3
+ import BaseServiceRESTControllerResults
4
+ from maleo_foundation.models.responses import BaseResponses
5
+
6
+ class RESTControllerResultsConstants:
7
+ BAD_REQUEST = BaseServiceRESTControllerResults(
8
+ success=False,
9
+ content=BaseResponses.BadRequest().model_dump(),
10
+ status_code=status.HTTP_400_BAD_REQUEST
11
+ )
12
+
13
+ INVALID_EXPAND = BaseServiceRESTControllerResults(
14
+ success=False,
15
+ content=BaseResponses.InvalidExpand().model_dump(),
16
+ status_code=status.HTTP_400_BAD_REQUEST
17
+ )
18
+
19
+ UNAUTHORIZED = BaseServiceRESTControllerResults(
20
+ success=False,
21
+ content=BaseResponses.Unauthorized().model_dump(),
22
+ status_code=status.HTTP_401_UNAUTHORIZED
23
+ )
24
+
25
+ FORBIDDEN = BaseServiceRESTControllerResults(
26
+ success=False,
27
+ content=BaseResponses.Forbidden().model_dump(),
28
+ status_code=status.HTTP_403_FORBIDDEN
29
+ )
30
+
31
+ METHOD_NOT_ALLOWED = BaseServiceRESTControllerResults(
32
+ success=False,
33
+ content=BaseResponses.MethodNotAllowed().model_dump(),
34
+ status_code=status.HTTP_405_METHOD_NOT_ALLOWED
35
+ )
36
+
37
+ VALIDATION_ERROR = BaseServiceRESTControllerResults(
38
+ success=False,
39
+ content=BaseResponses.ValidationError().model_dump(),
40
+ status_code=status.HTTP_422_UNPROCESSABLE_ENTITY
41
+ )
42
+
43
+ RATE_LIMIT_EXCEEDED = BaseServiceRESTControllerResults(
44
+ success=False,
45
+ content=BaseResponses.RateLimitExceeded().model_dump(),
46
+ status_code=status.HTTP_429_TOO_MANY_REQUESTS
47
+ )
48
+
49
+ SERVER_ERROR = BaseServiceRESTControllerResults(
50
+ success=False,
51
+ content=BaseResponses.ServerError().model_dump(),
52
+ status_code=status.HTTP_500_INTERNAL_SERVER_ERROR
53
+ )
54
+
55
+ NOT_IMPLEMENTED = BaseServiceRESTControllerResults(
56
+ success=False,
57
+ content=BaseResponses.NotImplemented().model_dump(),
58
+ status_code=status.HTTP_501_NOT_IMPLEMENTED
59
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.35
3
+ Version: 0.2.38
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -4,6 +4,7 @@ maleo_foundation/authorization.py,sha256=euq24UEhTaimmM24Ies-kZF1zqVwM_x0Zox_6k7
4
4
  maleo_foundation/constants.py,sha256=aBmEfWlBqZxi0k-n6h2NM1YRLOjMnheEiLyQcjP-zCQ,1164
5
5
  maleo_foundation/enums.py,sha256=OLVgb0rKk2gfG19FEyq9YGrQcmovr_FgtGFUcIu23Lo,3596
6
6
  maleo_foundation/extended_types.py,sha256=pIKt-_9tby4rmune3fmWcCW_mohaNRh_1lywBmdc-L4,301
7
+ maleo_foundation/rest_controller_result.py,sha256=4KbCmk70IEHj1L1bNJfFg1Y3ifnRSnmvK6dYyVJddok,2014
7
8
  maleo_foundation/types.py,sha256=aKXnIgEhYGSfFqNMGLc4qIKGkINBRpkOo9R9cb2CbwI,2414
8
9
  maleo_foundation/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
10
  maleo_foundation/client/manager.py,sha256=pFWLFYW4eE9MLyFmFS05IgnMBdqqUHbdyTkSbnBtm5E,2620
@@ -49,7 +50,7 @@ maleo_foundation/middlewares/authentication.py,sha256=y3FEvcB8I8piCQIvvDRl2F2tCm
49
50
  maleo_foundation/middlewares/base.py,sha256=8_ENtyB2iKejCOQofESzlAaq_zxDWtHNaq3f10dA020,14554
50
51
  maleo_foundation/middlewares/cors.py,sha256=9uvBvY2N6Vxa9RP_YtESxcWo6Doi6uS0lzAG9iLY7Uc,2288
51
52
  maleo_foundation/models/__init__.py,sha256=AaKehO7c1HyKhoTGRmNHDddSeBXkW-_YNrpOGBu8Ms8,246
52
- maleo_foundation/models/responses.py,sha256=iKJs9EFemCuUOc-IxEUwjX9RgNnPf-mw7yGheCGyVDA,4896
53
+ maleo_foundation/models/responses.py,sha256=nszxzni_Q_42bzjrKvUVGeB3GSn4Ba9g-Nqj1dfdJvk,5223
53
54
  maleo_foundation/models/table.py,sha256=tcOwj_Heqi6ode8rbD4eeSiixEYsAtUaUyJyqrYaMAw,1327
54
55
  maleo_foundation/models/schemas/__init__.py,sha256=Xj8Ahsqyra-fmEaVcGPok5GOOsPQlKcknHYMvbjvENA,277
55
56
  maleo_foundation/models/schemas/encryption.py,sha256=KYs2P57AqWpEROuqTuSuyt1Zk-jsIUKFeRWIfSwem74,658
@@ -116,7 +117,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
116
117
  maleo_foundation/utils/loaders/credential/google.py,sha256=SKsqPuFnAiCcYLf24CxKnMybhVHpgqnq1gGSlThqjts,994
117
118
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
118
119
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
119
- maleo_foundation-0.2.35.dist-info/METADATA,sha256=MgmHVupYy2wkBVXWM5qPW4Bm6LoRUJeZLpzr38xD404,3598
120
- maleo_foundation-0.2.35.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
121
- maleo_foundation-0.2.35.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
122
- maleo_foundation-0.2.35.dist-info/RECORD,,
120
+ maleo_foundation-0.2.38.dist-info/METADATA,sha256=Nxto_ED9tn2pyHaeZ3-0PCADZzFKqDzULDPqvdlkaXA,3598
121
+ maleo_foundation-0.2.38.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
122
+ maleo_foundation-0.2.38.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
123
+ maleo_foundation-0.2.38.dist-info/RECORD,,