File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ def __getattr__(name: str) -> Any:
4343 if name in gitlab .const ._DEPRECATED :
4444 _utils .warn (
4545 message = (
46- f"\n Direct access to 'gitlab.{ name } ' is deprecated and will be "
47- f"removed in a future major python-gitlab release. Please "
48- f"use 'gitlab.const. { name } ' instead."
46+ f"\n Direct access to constants as 'gitlab.{ name } ' is deprecated and "
47+ f"will be removed in a future major python-gitlab release. Please "
48+ f"see the usage of constants in the 'gitlab.const' module instead."
4949 ),
5050 category = DeprecationWarning ,
5151 )
Original file line number Diff line number Diff line change 5656]
5757
5858
59+ class GitlabEnum (str , Enum ):
60+ """An enum mixed in with str to make it JSON-serializable."""
61+
62+
5963# https://gitlab.com/gitlab-org/gitlab/-/blob/e97357824bedf007e75f8782259fe07435b64fbb/lib/gitlab/access.rb#L12-18
6064class AccessLevel (IntEnum ):
6165 NO_ACCESS : int = 0
@@ -69,13 +73,13 @@ class AccessLevel(IntEnum):
6973
7074
7175# https://gitlab.com/gitlab-org/gitlab/-/blob/e97357824bedf007e75f8782259fe07435b64fbb/lib/gitlab/visibility_level.rb#L23-25
72- class Visibility (Enum ):
76+ class Visibility (GitlabEnum ):
7377 PRIVATE : str = "private"
7478 INTERNAL : str = "internal"
7579 PUBLIC : str = "public"
7680
7781
78- class NotificationLevel (Enum ):
82+ class NotificationLevel (GitlabEnum ):
7983 DISABLED : str = "disabled"
8084 PARTICIPATING : str = "participating"
8185 WATCH : str = "watch"
@@ -85,7 +89,7 @@ class NotificationLevel(Enum):
8589
8690
8791# https://gitlab.com/gitlab-org/gitlab/-/blob/e97357824bedf007e75f8782259fe07435b64fbb/app/views/search/_category.html.haml#L10-37
88- class SearchScope (Enum ):
92+ class SearchScope (GitlabEnum ):
8993 # all scopes (global, group and project)
9094 PROJECTS : str = "projects"
9195 ISSUES : str = "issues"
You can’t perform that action at this time.
0 commit comments