python-gitlab 5.5.0__py3-none-any.whl → 6.0.0__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.
- gitlab/__init__.py +0 -1
- gitlab/_backends/protocol.py +9 -13
- gitlab/_backends/requests_backend.py +12 -12
- gitlab/_version.py +1 -1
- gitlab/base.py +48 -48
- gitlab/cli.py +14 -24
- gitlab/client.py +114 -140
- gitlab/config.py +16 -17
- gitlab/exceptions.py +7 -5
- gitlab/mixins.py +154 -238
- gitlab/types.py +13 -14
- gitlab/utils.py +32 -43
- gitlab/v4/cli.py +50 -53
- gitlab/v4/objects/__init__.py +1 -0
- gitlab/v4/objects/access_requests.py +11 -3
- gitlab/v4/objects/appearance.py +12 -14
- gitlab/v4/objects/applications.py +5 -6
- gitlab/v4/objects/artifacts.py +10 -17
- gitlab/v4/objects/audit_events.py +4 -19
- gitlab/v4/objects/award_emojis.py +13 -57
- gitlab/v4/objects/badges.py +4 -19
- gitlab/v4/objects/boards.py +7 -27
- gitlab/v4/objects/branches.py +3 -15
- gitlab/v4/objects/broadcast_messages.py +3 -13
- gitlab/v4/objects/bulk_imports.py +6 -14
- gitlab/v4/objects/ci_lint.py +7 -13
- gitlab/v4/objects/cluster_agents.py +3 -13
- gitlab/v4/objects/clusters.py +13 -23
- gitlab/v4/objects/commits.py +23 -28
- gitlab/v4/objects/container_registry.py +13 -19
- gitlab/v4/objects/custom_attributes.py +16 -21
- gitlab/v4/objects/deploy_keys.py +22 -19
- gitlab/v4/objects/deploy_tokens.py +14 -32
- gitlab/v4/objects/deployments.py +13 -15
- gitlab/v4/objects/discussions.py +13 -29
- gitlab/v4/objects/draft_notes.py +4 -14
- gitlab/v4/objects/environments.py +13 -21
- gitlab/v4/objects/epics.py +14 -17
- gitlab/v4/objects/events.py +27 -79
- gitlab/v4/objects/export_import.py +7 -19
- gitlab/v4/objects/features.py +11 -12
- gitlab/v4/objects/files.py +23 -38
- gitlab/v4/objects/geo_nodes.py +7 -11
- gitlab/v4/objects/group_access_tokens.py +6 -13
- gitlab/v4/objects/groups.py +42 -37
- gitlab/v4/objects/hooks.py +4 -17
- gitlab/v4/objects/integrations.py +7 -18
- gitlab/v4/objects/invitations.py +12 -23
- gitlab/v4/objects/issues.py +21 -27
- gitlab/v4/objects/iterations.py +4 -8
- gitlab/v4/objects/job_token_scope.py +18 -14
- gitlab/v4/objects/jobs.py +17 -32
- gitlab/v4/objects/keys.py +8 -11
- gitlab/v4/objects/labels.py +19 -30
- gitlab/v4/objects/ldap.py +25 -9
- gitlab/v4/objects/member_roles.py +102 -0
- gitlab/v4/objects/members.py +11 -29
- gitlab/v4/objects/merge_request_approvals.py +47 -38
- gitlab/v4/objects/merge_requests.py +30 -40
- gitlab/v4/objects/merge_trains.py +3 -6
- gitlab/v4/objects/milestones.py +23 -29
- gitlab/v4/objects/namespaces.py +4 -10
- gitlab/v4/objects/notes.py +26 -69
- gitlab/v4/objects/notification_settings.py +5 -14
- gitlab/v4/objects/package_protection_rules.py +8 -8
- gitlab/v4/objects/packages.py +22 -37
- gitlab/v4/objects/pages.py +8 -14
- gitlab/v4/objects/personal_access_tokens.py +7 -10
- gitlab/v4/objects/pipelines.py +38 -47
- gitlab/v4/objects/project_access_tokens.py +6 -13
- gitlab/v4/objects/projects.py +54 -76
- gitlab/v4/objects/push_rules.py +13 -15
- gitlab/v4/objects/registry_protection_repository_rules.py +6 -7
- gitlab/v4/objects/registry_protection_rules.py +7 -11
- gitlab/v4/objects/releases.py +6 -20
- gitlab/v4/objects/repositories.py +25 -34
- gitlab/v4/objects/resource_groups.py +10 -15
- gitlab/v4/objects/reviewers.py +4 -2
- gitlab/v4/objects/runners.py +14 -13
- gitlab/v4/objects/secure_files.py +8 -21
- gitlab/v4/objects/service_accounts.py +7 -5
- gitlab/v4/objects/settings.py +13 -14
- gitlab/v4/objects/sidekiq.py +17 -18
- gitlab/v4/objects/snippets.py +78 -66
- gitlab/v4/objects/statistics.py +8 -23
- gitlab/v4/objects/status_checks.py +6 -3
- gitlab/v4/objects/tags.py +3 -13
- gitlab/v4/objects/templates.py +11 -59
- gitlab/v4/objects/todos.py +3 -6
- gitlab/v4/objects/topics.py +10 -21
- gitlab/v4/objects/triggers.py +3 -13
- gitlab/v4/objects/users.py +87 -93
- gitlab/v4/objects/variables.py +4 -19
- gitlab/v4/objects/wikis.py +4 -19
- {python_gitlab-5.5.0.dist-info → python_gitlab-6.0.0.dist-info}/METADATA +3 -2
- python_gitlab-6.0.0.dist-info/RECORD +107 -0
- {python_gitlab-5.5.0.dist-info → python_gitlab-6.0.0.dist-info}/WHEEL +1 -1
- python_gitlab-5.5.0.dist-info/RECORD +0 -106
- {python_gitlab-5.5.0.dist-info → python_gitlab-6.0.0.dist-info}/entry_points.txt +0 -0
- {python_gitlab-5.5.0.dist-info → python_gitlab-6.0.0.dist-info/licenses}/AUTHORS +0 -0
- {python_gitlab-5.5.0.dist-info → python_gitlab-6.0.0.dist-info/licenses}/COPYING +0 -0
- {python_gitlab-5.5.0.dist-info → python_gitlab-6.0.0.dist-info}/top_level.txt +0 -0
gitlab/v4/objects/templates.py
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
from
|
2
|
-
|
3
|
-
from gitlab.base import RESTManager, RESTObject
|
1
|
+
from gitlab.base import RESTObject
|
4
2
|
from gitlab.mixins import RetrieveMixin
|
5
3
|
|
6
4
|
__all__ = [
|
@@ -31,141 +29,95 @@ class Dockerfile(RESTObject):
|
|
31
29
|
_id_attr = "name"
|
32
30
|
|
33
31
|
|
34
|
-
class DockerfileManager(RetrieveMixin
|
32
|
+
class DockerfileManager(RetrieveMixin[Dockerfile]):
|
35
33
|
_path = "/templates/dockerfiles"
|
36
34
|
_obj_cls = Dockerfile
|
37
35
|
|
38
|
-
def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Dockerfile:
|
39
|
-
return cast(Dockerfile, super().get(id=id, lazy=lazy, **kwargs))
|
40
|
-
|
41
36
|
|
42
37
|
class Gitignore(RESTObject):
|
43
38
|
_id_attr = "name"
|
44
39
|
|
45
40
|
|
46
|
-
class GitignoreManager(RetrieveMixin
|
41
|
+
class GitignoreManager(RetrieveMixin[Gitignore]):
|
47
42
|
_path = "/templates/gitignores"
|
48
43
|
_obj_cls = Gitignore
|
49
44
|
|
50
|
-
def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Gitignore:
|
51
|
-
return cast(Gitignore, super().get(id=id, lazy=lazy, **kwargs))
|
52
|
-
|
53
45
|
|
54
46
|
class Gitlabciyml(RESTObject):
|
55
47
|
_id_attr = "name"
|
56
48
|
|
57
49
|
|
58
|
-
class GitlabciymlManager(RetrieveMixin
|
50
|
+
class GitlabciymlManager(RetrieveMixin[Gitlabciyml]):
|
59
51
|
_path = "/templates/gitlab_ci_ymls"
|
60
52
|
_obj_cls = Gitlabciyml
|
61
53
|
|
62
|
-
def get(
|
63
|
-
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
64
|
-
) -> Gitlabciyml:
|
65
|
-
return cast(Gitlabciyml, super().get(id=id, lazy=lazy, **kwargs))
|
66
|
-
|
67
54
|
|
68
55
|
class License(RESTObject):
|
69
56
|
_id_attr = "key"
|
70
57
|
|
71
58
|
|
72
|
-
class LicenseManager(RetrieveMixin
|
59
|
+
class LicenseManager(RetrieveMixin[License]):
|
73
60
|
_path = "/templates/licenses"
|
74
61
|
_obj_cls = License
|
75
62
|
_list_filters = ("popular",)
|
76
63
|
_optional_get_attrs = ("project", "fullname")
|
77
64
|
|
78
|
-
def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> License:
|
79
|
-
return cast(License, super().get(id=id, lazy=lazy, **kwargs))
|
80
|
-
|
81
65
|
|
82
66
|
class ProjectDockerfileTemplate(RESTObject):
|
83
67
|
_id_attr = "name"
|
84
68
|
|
85
69
|
|
86
|
-
class ProjectDockerfileTemplateManager(RetrieveMixin
|
70
|
+
class ProjectDockerfileTemplateManager(RetrieveMixin[ProjectDockerfileTemplate]):
|
87
71
|
_path = "/projects/{project_id}/templates/dockerfiles"
|
88
72
|
_obj_cls = ProjectDockerfileTemplate
|
89
73
|
_from_parent_attrs = {"project_id": "id"}
|
90
74
|
|
91
|
-
def get(
|
92
|
-
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
93
|
-
) -> ProjectDockerfileTemplate:
|
94
|
-
return cast(ProjectDockerfileTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
95
|
-
|
96
75
|
|
97
76
|
class ProjectGitignoreTemplate(RESTObject):
|
98
77
|
_id_attr = "name"
|
99
78
|
|
100
79
|
|
101
|
-
class ProjectGitignoreTemplateManager(RetrieveMixin
|
80
|
+
class ProjectGitignoreTemplateManager(RetrieveMixin[ProjectGitignoreTemplate]):
|
102
81
|
_path = "/projects/{project_id}/templates/gitignores"
|
103
82
|
_obj_cls = ProjectGitignoreTemplate
|
104
83
|
_from_parent_attrs = {"project_id": "id"}
|
105
84
|
|
106
|
-
def get(
|
107
|
-
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
108
|
-
) -> ProjectGitignoreTemplate:
|
109
|
-
return cast(ProjectGitignoreTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
110
|
-
|
111
85
|
|
112
86
|
class ProjectGitlabciymlTemplate(RESTObject):
|
113
87
|
_id_attr = "name"
|
114
88
|
|
115
89
|
|
116
|
-
class ProjectGitlabciymlTemplateManager(RetrieveMixin
|
90
|
+
class ProjectGitlabciymlTemplateManager(RetrieveMixin[ProjectGitlabciymlTemplate]):
|
117
91
|
_path = "/projects/{project_id}/templates/gitlab_ci_ymls"
|
118
92
|
_obj_cls = ProjectGitlabciymlTemplate
|
119
93
|
_from_parent_attrs = {"project_id": "id"}
|
120
94
|
|
121
|
-
def get(
|
122
|
-
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
123
|
-
) -> ProjectGitlabciymlTemplate:
|
124
|
-
return cast(ProjectGitlabciymlTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
125
|
-
|
126
95
|
|
127
96
|
class ProjectLicenseTemplate(RESTObject):
|
128
97
|
_id_attr = "key"
|
129
98
|
|
130
99
|
|
131
|
-
class ProjectLicenseTemplateManager(RetrieveMixin
|
100
|
+
class ProjectLicenseTemplateManager(RetrieveMixin[ProjectLicenseTemplate]):
|
132
101
|
_path = "/projects/{project_id}/templates/licenses"
|
133
102
|
_obj_cls = ProjectLicenseTemplate
|
134
103
|
_from_parent_attrs = {"project_id": "id"}
|
135
104
|
|
136
|
-
def get(
|
137
|
-
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
138
|
-
) -> ProjectLicenseTemplate:
|
139
|
-
return cast(ProjectLicenseTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
140
|
-
|
141
105
|
|
142
106
|
class ProjectIssueTemplate(RESTObject):
|
143
107
|
_id_attr = "name"
|
144
108
|
|
145
109
|
|
146
|
-
class ProjectIssueTemplateManager(RetrieveMixin
|
110
|
+
class ProjectIssueTemplateManager(RetrieveMixin[ProjectIssueTemplate]):
|
147
111
|
_path = "/projects/{project_id}/templates/issues"
|
148
112
|
_obj_cls = ProjectIssueTemplate
|
149
113
|
_from_parent_attrs = {"project_id": "id"}
|
150
114
|
|
151
|
-
def get(
|
152
|
-
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
153
|
-
) -> ProjectIssueTemplate:
|
154
|
-
return cast(ProjectIssueTemplate, super().get(id=id, lazy=lazy, **kwargs))
|
155
|
-
|
156
115
|
|
157
116
|
class ProjectMergeRequestTemplate(RESTObject):
|
158
117
|
_id_attr = "name"
|
159
118
|
|
160
119
|
|
161
|
-
class ProjectMergeRequestTemplateManager(RetrieveMixin
|
120
|
+
class ProjectMergeRequestTemplateManager(RetrieveMixin[ProjectMergeRequestTemplate]):
|
162
121
|
_path = "/projects/{project_id}/templates/merge_requests"
|
163
122
|
_obj_cls = ProjectMergeRequestTemplate
|
164
123
|
_from_parent_attrs = {"project_id": "id"}
|
165
|
-
|
166
|
-
def get(
|
167
|
-
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
168
|
-
) -> ProjectMergeRequestTemplate:
|
169
|
-
return cast(
|
170
|
-
ProjectMergeRequestTemplate, super().get(id=id, lazy=lazy, **kwargs)
|
171
|
-
)
|
gitlab/v4/objects/todos.py
CHANGED
@@ -2,13 +2,10 @@ from typing import Any, Dict, TYPE_CHECKING
|
|
2
2
|
|
3
3
|
from gitlab import cli
|
4
4
|
from gitlab import exceptions as exc
|
5
|
-
from gitlab.base import
|
5
|
+
from gitlab.base import RESTObject
|
6
6
|
from gitlab.mixins import DeleteMixin, ListMixin, ObjectDeleteMixin
|
7
7
|
|
8
|
-
__all__ = [
|
9
|
-
"Todo",
|
10
|
-
"TodoManager",
|
11
|
-
]
|
8
|
+
__all__ = ["Todo", "TodoManager"]
|
12
9
|
|
13
10
|
|
14
11
|
class Todo(ObjectDeleteMixin, RESTObject):
|
@@ -35,7 +32,7 @@ class Todo(ObjectDeleteMixin, RESTObject):
|
|
35
32
|
return server_data
|
36
33
|
|
37
34
|
|
38
|
-
class TodoManager(ListMixin, DeleteMixin
|
35
|
+
class TodoManager(ListMixin[Todo], DeleteMixin[Todo]):
|
39
36
|
_path = "/todos"
|
40
37
|
_obj_cls = Todo
|
41
38
|
_list_filters = ("action", "author_id", "project_id", "state", "type")
|
gitlab/v4/objects/topics.py
CHANGED
@@ -1,23 +1,22 @@
|
|
1
|
-
from
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from typing import Any, TYPE_CHECKING
|
2
4
|
|
3
5
|
from gitlab import cli
|
4
6
|
from gitlab import exceptions as exc
|
5
7
|
from gitlab import types
|
6
|
-
from gitlab.base import
|
8
|
+
from gitlab.base import RESTObject
|
7
9
|
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
|
8
10
|
from gitlab.types import RequiredOptional
|
9
11
|
|
10
|
-
__all__ = [
|
11
|
-
"Topic",
|
12
|
-
"TopicManager",
|
13
|
-
]
|
12
|
+
__all__ = ["Topic", "TopicManager"]
|
14
13
|
|
15
14
|
|
16
15
|
class Topic(SaveMixin, ObjectDeleteMixin, RESTObject):
|
17
16
|
pass
|
18
17
|
|
19
18
|
|
20
|
-
class TopicManager(CRUDMixin
|
19
|
+
class TopicManager(CRUDMixin[Topic]):
|
21
20
|
_path = "/topics"
|
22
21
|
_obj_cls = Topic
|
23
22
|
_create_attrs = RequiredOptional(
|
@@ -29,20 +28,13 @@ class TopicManager(CRUDMixin, RESTManager):
|
|
29
28
|
_update_attrs = RequiredOptional(optional=("avatar", "description", "name"))
|
30
29
|
_types = {"avatar": types.ImageAttribute}
|
31
30
|
|
32
|
-
def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Topic:
|
33
|
-
return cast(Topic, super().get(id=id, lazy=lazy, **kwargs))
|
34
|
-
|
35
31
|
@cli.register_custom_action(
|
36
|
-
cls_names="TopicManager",
|
37
|
-
required=("source_topic_id", "target_topic_id"),
|
32
|
+
cls_names="TopicManager", required=("source_topic_id", "target_topic_id")
|
38
33
|
)
|
39
34
|
@exc.on_http_error(exc.GitlabMRClosedError)
|
40
35
|
def merge(
|
41
|
-
self,
|
42
|
-
|
43
|
-
target_topic_id: Union[int, str],
|
44
|
-
**kwargs: Any,
|
45
|
-
) -> Dict[str, Any]:
|
36
|
+
self, source_topic_id: int | str, target_topic_id: int | str, **kwargs: Any
|
37
|
+
) -> dict[str, Any]:
|
46
38
|
"""Merge two topics, assigning all projects to the target topic.
|
47
39
|
|
48
40
|
Args:
|
@@ -58,10 +50,7 @@ class TopicManager(CRUDMixin, RESTManager):
|
|
58
50
|
The merged topic data (*not* a RESTObject)
|
59
51
|
"""
|
60
52
|
path = f"{self.path}/merge"
|
61
|
-
data = {
|
62
|
-
"source_topic_id": source_topic_id,
|
63
|
-
"target_topic_id": target_topic_id,
|
64
|
-
}
|
53
|
+
data = {"source_topic_id": source_topic_id, "target_topic_id": target_topic_id}
|
65
54
|
|
66
55
|
server_data = self.gitlab.http_post(path, post_data=data, **kwargs)
|
67
56
|
if TYPE_CHECKING:
|
gitlab/v4/objects/triggers.py
CHANGED
@@ -1,27 +1,17 @@
|
|
1
|
-
from
|
2
|
-
|
3
|
-
from gitlab.base import RESTManager, RESTObject
|
1
|
+
from gitlab.base import RESTObject
|
4
2
|
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
|
5
3
|
from gitlab.types import RequiredOptional
|
6
4
|
|
7
|
-
__all__ = [
|
8
|
-
"ProjectTrigger",
|
9
|
-
"ProjectTriggerManager",
|
10
|
-
]
|
5
|
+
__all__ = ["ProjectTrigger", "ProjectTriggerManager"]
|
11
6
|
|
12
7
|
|
13
8
|
class ProjectTrigger(SaveMixin, ObjectDeleteMixin, RESTObject):
|
14
9
|
pass
|
15
10
|
|
16
11
|
|
17
|
-
class ProjectTriggerManager(CRUDMixin
|
12
|
+
class ProjectTriggerManager(CRUDMixin[ProjectTrigger]):
|
18
13
|
_path = "/projects/{project_id}/triggers"
|
19
14
|
_obj_cls = ProjectTrigger
|
20
15
|
_from_parent_attrs = {"project_id": "id"}
|
21
16
|
_create_attrs = RequiredOptional(required=("description",))
|
22
17
|
_update_attrs = RequiredOptional(required=("description",))
|
23
|
-
|
24
|
-
def get(
|
25
|
-
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
26
|
-
) -> ProjectTrigger:
|
27
|
-
return cast(ProjectTrigger, super().get(id=id, lazy=lazy, **kwargs))
|