|
15 | 15 | # You should have received a copy of the GNU Lesser General Public License
|
16 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 | 17 |
|
| 18 | +from enum import Enum |
| 19 | + |
18 | 20 | from gitlab.__version__ import __title__, __version__
|
19 | 21 |
|
20 | 22 | DEFAULT_URL: str = "https://gitlab.com"
|
21 | 23 |
|
| 24 | +# TODO: deprecate these in favor of AccessLevel |
22 | 25 | NO_ACCESS: int = 0
|
23 | 26 | MINIMAL_ACCESS: int = 5
|
24 | 27 | GUEST_ACCESS: int = 10
|
|
27 | 30 | MAINTAINER_ACCESS: int = 40
|
28 | 31 | OWNER_ACCESS: int = 50
|
29 | 32 |
|
| 33 | + |
| 34 | +class AccessLevel(Enum): |
| 35 | + NO_ACCESS: int = 0 |
| 36 | + MINIMAL_ACCESS: int = 5 |
| 37 | + GUEST_ACCESS: int = 10 |
| 38 | + REPORTER_ACCESS: int = 20 |
| 39 | + DEVELOPER_ACCESS: int = 30 |
| 40 | + MAINTAINER_ACCESS: int = 40 |
| 41 | + OWNER_ACCESS: int = 50 |
| 42 | + |
| 43 | + |
| 44 | +# TODO: deprecate these in favor of Visibility |
30 | 45 | VISIBILITY_PRIVATE: str = "private"
|
31 | 46 | VISIBILITY_INTERNAL: str = "internal"
|
32 | 47 | VISIBILITY_PUBLIC: str = "public"
|
33 | 48 |
|
| 49 | + |
| 50 | +class Visibility(Enum): |
| 51 | + VISIBILITY_PRIVATE: str = "private" |
| 52 | + VISIBILITY_INTERNAL: str = "internal" |
| 53 | + VISIBILITY_PUBLIC: str = "public" |
| 54 | + |
| 55 | + |
| 56 | +# TODO: deprecate these in favor of NotificationLevel |
34 | 57 | NOTIFICATION_LEVEL_DISABLED: str = "disabled"
|
35 | 58 | NOTIFICATION_LEVEL_PARTICIPATING: str = "participating"
|
36 | 59 | NOTIFICATION_LEVEL_WATCH: str = "watch"
|
37 | 60 | NOTIFICATION_LEVEL_GLOBAL: str = "global"
|
38 | 61 | NOTIFICATION_LEVEL_MENTION: str = "mention"
|
39 | 62 | NOTIFICATION_LEVEL_CUSTOM: str = "custom"
|
40 | 63 |
|
| 64 | + |
| 65 | +class NotificationLevel(Enum): |
| 66 | + NOTIFICATION_LEVEL_DISABLED: str = "disabled" |
| 67 | + NOTIFICATION_LEVEL_PARTICIPATING: str = "participating" |
| 68 | + NOTIFICATION_LEVEL_WATCH: str = "watch" |
| 69 | + NOTIFICATION_LEVEL_GLOBAL: str = "global" |
| 70 | + NOTIFICATION_LEVEL_MENTION: str = "mention" |
| 71 | + NOTIFICATION_LEVEL_CUSTOM: str = "custom" |
| 72 | + |
| 73 | + |
| 74 | +# TODO: deprecate these in favor of SearchScope |
41 | 75 | # Search scopes
|
42 | 76 | # all scopes (global, group and project)
|
43 | 77 | SEARCH_SCOPE_PROJECTS: str = "projects"
|
|
49 | 83 | SEARCH_SCOPE_BLOBS: str = "blobs"
|
50 | 84 | SEARCH_SCOPE_USERS: str = "users"
|
51 | 85 |
|
| 86 | + |
| 87 | +# Search scopes |
| 88 | +# all scopes (global, group and project) |
| 89 | +class SearchScope(Enum): |
| 90 | + SEARCH_SCOPE_PROJECTS: str = "projects" |
| 91 | + SEARCH_SCOPE_ISSUES: str = "issues" |
| 92 | + SEARCH_SCOPE_MERGE_REQUESTS: str = "merge_requests" |
| 93 | + SEARCH_SCOPE_MILESTONES: str = "milestones" |
| 94 | + SEARCH_SCOPE_WIKI_BLOBS: str = "wiki_blobs" |
| 95 | + SEARCH_SCOPE_COMMITS: str = "commits" |
| 96 | + SEARCH_SCOPE_BLOBS: str = "blobs" |
| 97 | + SEARCH_SCOPE_USERS: str = "users" |
| 98 | + |
| 99 | + |
52 | 100 | # specific global scope
|
53 | 101 | SEARCH_SCOPE_GLOBAL_SNIPPET_TITLES: str = "snippet_titles"
|
54 | 102 |
|
|
0 commit comments