rb-commons 0.7.16__py3-none-any.whl → 0.7.18__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.
@@ -1,41 +1,41 @@
1
- from fastapi import HTTPException, status
2
-
3
-
4
- class CustomHTTPException(HTTPException):
5
- def __init__(self, message: str, status: int, code: str = None, additional_info: dict = None):
6
- super().__init__(status_code=status, detail=message)
7
-
8
- self.code = code
9
- self.message = message
10
- self.status = status
11
- self.additional_info = additional_info
12
-
13
-
14
- class NotAuthorizedException(CustomHTTPException):
15
- def __init__(self, message: str = "You are not authorized", status: int = 401, code: str = None,
16
- additional_info: dict = None):
17
- super().__init__(message=message, status=status, code=code, additional_info=additional_info)
18
-
19
-
20
- class ForbiddenException(CustomHTTPException):
21
- def __init__(self, message: str = "Permission denied", status: int = 403, code: str = None,
22
- additional_info: dict = None):
23
- super().__init__(message=message, status=status, code=code, additional_info=additional_info)
24
-
25
-
26
- class BadRequestException(CustomHTTPException):
27
- def __init__(self, message: str = "Bad request", status: int = 400, code: str = None,
28
- additional_info: dict = None):
29
- super().__init__(message=message, status=status, code=code, additional_info=additional_info)
30
-
31
-
32
- class NotFoundException(CustomHTTPException):
33
- def __init__(self, message: str = "Not found", status: int = 404, code: str = None,
34
- additional_info: dict = None):
35
- super().__init__(message=message, status=status, code=code, additional_info=additional_info)
36
-
37
-
38
- class InternalException(CustomHTTPException):
39
- def __init__(self, message: str = "Internal exception", status: int = 500, code: str = None,
40
- additional_info: dict = None):
41
- super().__init__(message=message, status=status, code=code, additional_info=additional_info)
1
+ from fastapi import HTTPException, status
2
+
3
+
4
+ class CustomHTTPException(HTTPException):
5
+ def __init__(self, message: str, status: int, code: str = None, additional_info: dict = None):
6
+ super().__init__(status_code=status, detail=message)
7
+
8
+ self.code = code
9
+ self.message = message
10
+ self.status = status
11
+ self.additional_info = additional_info
12
+
13
+
14
+ class NotAuthorizedException(CustomHTTPException):
15
+ def __init__(self, message: str = "You are not authorized", status: int = 401, code: str = None,
16
+ additional_info: dict = None):
17
+ super().__init__(message=message, status=status, code=code, additional_info=additional_info)
18
+
19
+
20
+ class ForbiddenException(CustomHTTPException):
21
+ def __init__(self, message: str = "Permission denied", status: int = 403, code: str = None,
22
+ additional_info: dict = None):
23
+ super().__init__(message=message, status=status, code=code, additional_info=additional_info)
24
+
25
+
26
+ class BadRequestException(CustomHTTPException):
27
+ def __init__(self, message: str = "Bad request", status: int = 400, code: str = None,
28
+ additional_info: dict = None):
29
+ super().__init__(message=message, status=status, code=code, additional_info=additional_info)
30
+
31
+
32
+ class NotFoundException(CustomHTTPException):
33
+ def __init__(self, message: str = "Not found", status: int = 404, code: str = None,
34
+ additional_info: dict = None):
35
+ super().__init__(message=message, status=status, code=code, additional_info=additional_info)
36
+
37
+
38
+ class InternalException(CustomHTTPException):
39
+ def __init__(self, message: str = "Internal exception", status: int = 500, code: str = None,
40
+ additional_info: dict = None):
41
+ super().__init__(message=message, status=status, code=code, additional_info=additional_info)
rb_commons/orm/enum.py CHANGED
@@ -1,19 +1,21 @@
1
- from enum import Enum
2
-
3
- class OriginType(str, Enum):
4
- MANUAL = "MANUAL"
5
- ETL = "ETL"
6
- API = "API"
7
- DEFAULT = "DEFAULT"
8
- BILLZ = "BILLZ"
9
- BITO = "BITO"
10
- SMARTUP = "SMARTUP"
11
- DIZGO = "DIZGO"
12
- ERA = "ERA"
13
-
14
- class MediaSource(str, Enum):
15
- ROBO = "ROBO"
16
- BILLZ = "BILLZ"
17
- BITO = "BITO"
18
- EUROPHARM = "EUROPHARM"
19
- DIZGO = "DIZGO"
1
+ from enum import Enum
2
+
3
+ class OriginType(str, Enum):
4
+ MANUAL = "MANUAL"
5
+ ETL = "ETL"
6
+ API = "API"
7
+ DEFAULT = "DEFAULT"
8
+ BILLZ = "BILLZ"
9
+ BITO = "BITO"
10
+ SMARTUP = "SMARTUP"
11
+ DIZGO = "DIZGO"
12
+ ERA = "ERA"
13
+ YESPOS = "YESPOS"
14
+
15
+ class MediaSource(str, Enum):
16
+ ROBO = "ROBO"
17
+ BILLZ = "BILLZ"
18
+ BITO = "BITO"
19
+ EUROPHARM = "EUROPHARM"
20
+ DIZGO = "DIZGO"
21
+ YESPOS = "YESPOS"
@@ -1,11 +1,11 @@
1
- class DatabaseException(Exception):
2
- def __init__(self, text: str, user_id: int | None = None , original_exception=None):
3
- self.user_id = user_id
4
- self.text = text
5
- self.original_exception = original_exception
6
-
7
- class InternalException(Exception):
8
- def __init__(self, text: str, user_id: int | None = None, telegram_id: int | None = None, original_exception=None):
9
- self.user_id = user_id
10
- self.text = text
1
+ class DatabaseException(Exception):
2
+ def __init__(self, text: str, user_id: int | None = None , original_exception=None):
3
+ self.user_id = user_id
4
+ self.text = text
5
+ self.original_exception = original_exception
6
+
7
+ class InternalException(Exception):
8
+ def __init__(self, text: str, user_id: int | None = None, telegram_id: int | None = None, original_exception=None):
9
+ self.user_id = user_id
10
+ self.text = text
11
11
  self.original_exception = original_exception