| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 94feb8a commit 46773a8
21 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,8 @@ | |||
| 2 | 2 | GitLab API: | |
| 3 | 3 | https://docs.gitlab.com/ee/api/audit_events.html | |
| 4 | 4 | """ | |
| 5 | + from typing import Any, cast, Union | ||
| 6 | + | ||
| 5 | 7 | from gitlab.base import RESTManager, RESTObject | |
| 6 | 8 | from gitlab.mixins import RetrieveMixin | |
| 7 | 9 | ||
@@ -26,6 +28,9 @@ class AuditEventManager(RetrieveMixin, RESTManager): | |||
| 26 | 28 | _obj_cls = AuditEvent | |
| 27 | 29 | _list_filters = ("created_after", "created_before", "entity_type", "entity_id") | |
| 28 | 30 | ||
| 31 | + def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> AuditEvent: | ||
| 32 | + return cast(AuditEvent, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 33 | + | ||
| 29 | 34 | ||
| 30 | 35 | class GroupAuditEvent(RESTObject): | |
| 31 | 36 | _id_attr = "id" | |
@@ -37,6 +42,11 @@ class GroupAuditEventManager(RetrieveMixin, RESTManager): | |||
| 37 | 42 | _from_parent_attrs = {"group_id": "id"} | |
| 38 | 43 | _list_filters = ("created_after", "created_before") | |
| 39 | 44 | ||
| 45 | + def get( | ||
| 46 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 47 | + ) -> GroupAuditEvent: | ||
| 48 | + return cast(GroupAuditEvent, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 49 | + | ||
| 40 | 50 | ||
| 41 | 51 | class ProjectAuditEvent(RESTObject): | |
| 42 | 52 | _id_attr = "id" | |
@@ -48,6 +58,11 @@ class ProjectAuditEventManager(RetrieveMixin, RESTManager): | |||
| 48 | 58 | _from_parent_attrs = {"project_id": "id"} | |
| 49 | 59 | _list_filters = ("created_after", "created_before") | |
| 50 | 60 | ||
| 61 | + def get( | ||
| 62 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 63 | + ) -> ProjectAuditEvent: | ||
| 64 | + return cast(ProjectAuditEvent, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 65 | + | ||
| 51 | 66 | ||
| 52 | 67 | class ProjectAudit(ProjectAuditEvent): | |
| 53 | 68 | pass | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,5 @@ | |||
| 1 | + from typing import Any, cast, Union | ||
| 2 | + | ||
| 1 | 3 | from gitlab.base import RequiredOptional, RESTManager, RESTObject | |
| 2 | 4 | from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin | |
| 3 | 5 | ||
@@ -27,6 +29,11 @@ class ProjectIssueAwardEmojiManager(NoUpdateMixin, RESTManager): | |||
| 27 | 29 | _from_parent_attrs = {"project_id": "project_id", "issue_iid": "iid"} | |
| 28 | 30 | _create_attrs = RequiredOptional(required=("name",)) | |
| 29 | 31 | ||
| 32 | + def get( | ||
| 33 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 34 | + ) -> ProjectIssueAwardEmoji: | ||
| 35 | + return cast(ProjectIssueAwardEmoji, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 36 | + | ||
| 30 | 37 | ||
| 31 | 38 | class ProjectIssueNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | |
| 32 | 39 | pass | |
@@ -42,6 +49,11 @@ class ProjectIssueNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | |||
| 42 | 49 | } | |
| 43 | 50 | _create_attrs = RequiredOptional(required=("name",)) | |
| 44 | 51 | ||
| 52 | + def get( | ||
| 53 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 54 | + ) -> ProjectIssueNoteAwardEmoji: | ||
| 55 | + return cast(ProjectIssueNoteAwardEmoji, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 56 | + | ||
| 45 | 57 | ||
| 46 | 58 | class ProjectMergeRequestAwardEmoji(ObjectDeleteMixin, RESTObject): | |
| 47 | 59 | pass | |
@@ -53,6 +65,13 @@ class ProjectMergeRequestAwardEmojiManager(NoUpdateMixin, RESTManager): | |||
| 53 | 65 | _from_parent_attrs = {"project_id": "project_id", "mr_iid": "iid"} | |
| 54 | 66 | _create_attrs = RequiredOptional(required=("name",)) | |
| 55 | 67 | ||
| 68 | + def get( | ||
| 69 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 70 | + ) -> ProjectMergeRequestAwardEmoji: | ||
| 71 | + return cast( | ||
| 72 | + ProjectMergeRequestAwardEmoji, super().get(id=id, lazy=lazy, **kwargs) | ||
| 73 | + ) | ||
| 74 | + | ||
| 56 | 75 | ||
| 57 | 76 | class ProjectMergeRequestNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | |
| 58 | 77 | pass | |
@@ -68,6 +87,13 @@ class ProjectMergeRequestNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | |||
| 68 | 87 | } | |
| 69 | 88 | _create_attrs = RequiredOptional(required=("name",)) | |
| 70 | 89 | ||
| 90 | + def get( | ||
| 91 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 92 | + ) -> ProjectMergeRequestNoteAwardEmoji: | ||
| 93 | + return cast( | ||
| 94 | + ProjectMergeRequestNoteAwardEmoji, super().get(id=id, lazy=lazy, **kwargs) | ||
| 95 | + ) | ||
| 96 | + | ||
| 71 | 97 | ||
| 72 | 98 | class ProjectSnippetAwardEmoji(ObjectDeleteMixin, RESTObject): | |
| 73 | 99 | pass | |
@@ -79,6 +105,11 @@ class ProjectSnippetAwardEmojiManager(NoUpdateMixin, RESTManager): | |||
| 79 | 105 | _from_parent_attrs = {"project_id": "project_id", "snippet_id": "id"} | |
| 80 | 106 | _create_attrs = RequiredOptional(required=("name",)) | |
| 81 | 107 | ||
| 108 | + def get( | ||
| 109 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 110 | + ) -> ProjectSnippetAwardEmoji: | ||
| 111 | + return cast(ProjectSnippetAwardEmoji, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 112 | + | ||
| 82 | 113 | ||
| 83 | 114 | class ProjectSnippetNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | |
| 84 | 115 | pass | |
@@ -93,3 +124,10 @@ class ProjectSnippetNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | |||
| 93 | 124 | "note_id": "id", | |
| 94 | 125 | } | |
| 95 | 126 | _create_attrs = RequiredOptional(required=("name",)) | |
| 127 | + | ||
| 128 | + def get( | ||
| 129 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 130 | + ) -> ProjectSnippetNoteAwardEmoji: | ||
| 131 | + return cast( | ||
| 132 | + ProjectSnippetNoteAwardEmoji, super().get(id=id, lazy=lazy, **kwargs) | ||
| 133 | + ) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,9 @@ class GroupBadgeManager(BadgeRenderMixin, CRUDMixin, RESTManager): | |||
| 22 | 22 | _create_attrs = RequiredOptional(required=("link_url", "image_url")) | |
| 23 | 23 | _update_attrs = RequiredOptional(optional=("link_url", "image_url")) | |
| 24 | 24 | ||
| 25 | + def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> GroupBadge: | ||
| 26 | + return cast(GroupBadge, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 27 | + | ||
| 25 | 28 | ||
| 26 | 29 | class ProjectBadge(SaveMixin, ObjectDeleteMixin, RESTObject): | |
| 27 | 30 | pass | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,5 @@ | |||
| 1 | + from typing import Any, cast, Union | ||
| 2 | + | ||
| 1 | 3 | from gitlab.base import RequiredOptional, RESTManager, RESTObject | |
| 2 | 4 | from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin | |
| 3 | 5 | ||
@@ -19,6 +21,11 @@ class ProjectBranchManager(NoUpdateMixin, RESTManager): | |||
| 19 | 21 | _from_parent_attrs = {"project_id": "id"} | |
| 20 | 22 | _create_attrs = RequiredOptional(required=("branch", "ref")) | |
| 21 | 23 | ||
| 24 | + def get( | ||
| 25 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 26 | + ) -> ProjectBranch: | ||
| 27 | + return cast(ProjectBranch, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 28 | + | ||
| 22 | 29 | ||
| 23 | 30 | class ProjectProtectedBranch(ObjectDeleteMixin, RESTObject): | |
| 24 | 31 | _id_attr = "name" | |
@@ -40,3 +47,8 @@ class ProjectProtectedBranchManager(NoUpdateMixin, RESTManager): | |||
| 40 | 47 | "code_owner_approval_required", | |
| 41 | 48 | ), | |
| 42 | 49 | ) | |
| 50 | + | ||
| 51 | + def get( | ||
| 52 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 53 | + ) -> ProjectProtectedBranch: | ||
| 54 | + return cast(ProjectProtectedBranch, super().get(id=id, lazy=lazy, **kwargs)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - from typing import Any, cast, Dict, Optional | ||
| 1 | + from typing import Any, cast, Dict, Optional, Union | ||
| 2 | 2 | ||
| 3 | 3 | from gitlab import exceptions as exc | |
| 4 | 4 | from gitlab.base import RequiredOptional, RESTManager, RESTObject | |
@@ -57,6 +57,11 @@ def create( | |||
| 57 | 57 | path = f"{self.path}/user" | |
| 58 | 58 | return cast(GroupCluster, CreateMixin.create(self, data, path=path, **kwargs)) | |
| 59 | 59 | ||
| 60 | + def get( | ||
| 61 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 62 | + ) -> GroupCluster: | ||
| 63 | + return cast(GroupCluster, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 64 | + | ||
| 60 | 65 | ||
| 61 | 66 | class ProjectCluster(SaveMixin, ObjectDeleteMixin, RESTObject): | |
| 62 | 67 | pass | |
@@ -102,3 +107,8 @@ def create( | |||
| 102 | 107 | """ | |
| 103 | 108 | path = f"{self.path}/user" | |
| 104 | 109 | return cast(ProjectCluster, CreateMixin.create(self, data, path=path, **kwargs)) | |
| 110 | + | ||
| 111 | + def get( | ||
| 112 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 113 | + ) -> ProjectCluster: | ||
| 114 | + return cast(ProjectCluster, super().get(id=id, lazy=lazy, **kwargs)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,6 +151,11 @@ class ProjectCommitManager(RetrieveMixin, CreateMixin, RESTManager): | |||
| 151 | 151 | optional=("author_email", "author_name"), | |
| 152 | 152 | ) | |
| 153 | 153 | ||
| 154 | + def get( | ||
| 155 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 156 | + ) -> ProjectCommit: | ||
| 157 | + return cast(ProjectCommit, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 158 | + | ||
| 154 | 159 | ||
| 155 | 160 | class ProjectCommitComment(RESTObject): | |
| 156 | 161 | _id_attr = None | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - from typing import Any, TYPE_CHECKING | ||
| 1 | + from typing import Any, cast, TYPE_CHECKING, Union | ||
| 2 | 2 | ||
| 3 | 3 | from gitlab import cli | |
| 4 | 4 | from gitlab import exceptions as exc | |
@@ -60,3 +60,8 @@ def delete_in_bulk(self, name_regex_delete: str, **kwargs: Any) -> None: | |||
| 60 | 60 | if TYPE_CHECKING: | |
| 61 | 61 | assert self.path is not None | |
| 62 | 62 | self.gitlab.http_delete(self.path, query_data=data, **kwargs) | |
| 63 | + | ||
| 64 | + def get( | ||
| 65 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 66 | + ) -> ProjectRegistryTag: | ||
| 67 | + return cast(ProjectRegistryTag, super().get(id=id, lazy=lazy, **kwargs)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,5 @@ | |||
| 1 | + from typing import Any, cast, Union | ||
| 2 | + | ||
| 1 | 3 | from gitlab.base import RESTManager, RESTObject | |
| 2 | 4 | from gitlab.mixins import DeleteMixin, ObjectDeleteMixin, RetrieveMixin, SetMixin | |
| 3 | 5 | ||
@@ -20,6 +22,11 @@ class GroupCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin, RESTMana | |||
| 20 | 22 | _obj_cls = GroupCustomAttribute | |
| 21 | 23 | _from_parent_attrs = {"group_id": "id"} | |
| 22 | 24 | ||
| 25 | + def get( | ||
| 26 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 27 | + ) -> GroupCustomAttribute: | ||
| 28 | + return cast(GroupCustomAttribute, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 29 | + | ||
| 23 | 30 | ||
| 24 | 31 | class ProjectCustomAttribute(ObjectDeleteMixin, RESTObject): | |
| 25 | 32 | _id_attr = "key" | |
@@ -30,6 +37,11 @@ class ProjectCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin, RESTMa | |||
| 30 | 37 | _obj_cls = ProjectCustomAttribute | |
| 31 | 38 | _from_parent_attrs = {"project_id": "id"} | |
| 32 | 39 | ||
| 40 | + def get( | ||
| 41 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 42 | + ) -> ProjectCustomAttribute: | ||
| 43 | + return cast(ProjectCustomAttribute, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 44 | + | ||
| 33 | 45 | ||
| 34 | 46 | class UserCustomAttribute(ObjectDeleteMixin, RESTObject): | |
| 35 | 47 | _id_attr = "key" | |
@@ -39,3 +51,8 @@ class UserCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin, RESTManag | |||
| 39 | 51 | _path = "/users/{user_id}/custom_attributes" | |
| 40 | 52 | _obj_cls = UserCustomAttribute | |
| 41 | 53 | _from_parent_attrs = {"user_id": "id"} | |
| 54 | + | ||
| 55 | + def get( | ||
| 56 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 57 | + ) -> UserCustomAttribute: | ||
| 58 | + return cast(UserCustomAttribute, super().get(id=id, lazy=lazy, **kwargs)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,5 @@ | |||
| 1 | + from typing import Any, cast, Union | ||
| 2 | + | ||
| 1 | 3 | from gitlab.base import RequiredOptional, RESTManager, RESTObject | |
| 2 | 4 | from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin | |
| 3 | 5 | ||
@@ -28,3 +30,8 @@ class ProjectDeploymentManager(RetrieveMixin, CreateMixin, UpdateMixin, RESTMana | |||
| 28 | 30 | _create_attrs = RequiredOptional( | |
| 29 | 31 | required=("sha", "ref", "tag", "status", "environment") | |
| 30 | 32 | ) | |
| 33 | + | ||
| 34 | + def get( | ||
| 35 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 36 | + ) -> ProjectDeployment: | ||
| 37 | + return cast(ProjectDeployment, super().get(id=id, lazy=lazy, **kwargs)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,5 @@ | |||
| 1 | + from typing import Any, cast, Union | ||
| 2 | + | ||
| 1 | 3 | from gitlab.base import RequiredOptional, RESTManager, RESTObject | |
| 2 | 4 | from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin | |
| 3 | 5 | ||
@@ -30,6 +32,11 @@ class ProjectCommitDiscussionManager(RetrieveMixin, CreateMixin, RESTManager): | |||
| 30 | 32 | _from_parent_attrs = {"project_id": "project_id", "commit_id": "id"} | |
| 31 | 33 | _create_attrs = RequiredOptional(required=("body",), optional=("created_at",)) | |
| 32 | 34 | ||
| 35 | + def get( | ||
| 36 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 37 | + ) -> ProjectCommitDiscussion: | ||
| 38 | + return cast(ProjectCommitDiscussion, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 39 | + | ||
| 33 | 40 | ||
| 34 | 41 | class ProjectIssueDiscussion(RESTObject): | |
| 35 | 42 | notes: ProjectIssueDiscussionNoteManager | |
@@ -41,6 +48,11 @@ class ProjectIssueDiscussionManager(RetrieveMixin, CreateMixin, RESTManager): | |||
| 41 | 48 | _from_parent_attrs = {"project_id": "project_id", "issue_iid": "iid"} | |
| 42 | 49 | _create_attrs = RequiredOptional(required=("body",), optional=("created_at",)) | |
| 43 | 50 | ||
| 51 | + def get( | ||
| 52 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 53 | + ) -> ProjectIssueDiscussion: | ||
| 54 | + return cast(ProjectIssueDiscussion, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 55 | + | ||
| 44 | 56 | ||
| 45 | 57 | class ProjectMergeRequestDiscussion(SaveMixin, RESTObject): | |
| 46 | 58 | notes: ProjectMergeRequestDiscussionNoteManager | |
@@ -57,6 +69,13 @@ class ProjectMergeRequestDiscussionManager( | |||
| 57 | 69 | ) | |
| 58 | 70 | _update_attrs = RequiredOptional(required=("resolved",)) | |
| 59 | 71 | ||
| 72 | + def get( | ||
| 73 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 74 | + ) -> ProjectMergeRequestDiscussion: | ||
| 75 | + return cast( | ||
| 76 | + ProjectMergeRequestDiscussion, super().get(id=id, lazy=lazy, **kwargs) | ||
| 77 | + ) | ||
| 78 | + | ||
| 60 | 79 | ||
| 61 | 80 | class ProjectSnippetDiscussion(RESTObject): | |
| 62 | 81 | notes: ProjectSnippetDiscussionNoteManager | |
@@ -67,3 +86,8 @@ class ProjectSnippetDiscussionManager(RetrieveMixin, CreateMixin, RESTManager): | |||
| 67 | 86 | _obj_cls = ProjectSnippetDiscussion | |
| 68 | 87 | _from_parent_attrs = {"project_id": "project_id", "snippet_id": "id"} | |
| 69 | 88 | _create_attrs = RequiredOptional(required=("body",), optional=("created_at",)) | |
| 89 | + | ||
| 90 | + def get( | ||
| 91 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 92 | + ) -> ProjectSnippetDiscussion: | ||
| 93 | + return cast(ProjectSnippetDiscussion, super().get(id=id, lazy=lazy, **kwargs)) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments