diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-05-27 17:35:33 +0200 |
---|---|---|
committer | John Villalovos <john@sodarock.com> | 2022-05-27 08:55:35 -0700 |
commit | 8867ee59884ae81d6457ad6e561a0573017cf6b2 (patch) | |
tree | 0b8fde1660337708019582ffa47d7f2cc374d8e5 /gitlab/v4/objects | |
parent | 792cee939843d8df4c87bb8068be147ec97fabac (diff) | |
download | gitlab-8867ee59884ae81d6457ad6e561a0573017cf6b2.tar.gz |
feat(objects): support get project storage endpoint
Diffstat (limited to 'gitlab/v4/objects')
-rw-r--r-- | gitlab/v4/objects/projects.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index b7df9ab..443eb3d 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -9,6 +9,7 @@ from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import ( CreateMixin, CRUDMixin, + GetWithoutIdMixin, ListMixin, ObjectDeleteMixin, RefreshMixin, @@ -80,6 +81,8 @@ __all__ = [ "ProjectForkManager", "ProjectRemoteMirror", "ProjectRemoteMirrorManager", + "ProjectStorage", + "ProjectStorageManager", ] @@ -180,6 +183,7 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO runners: ProjectRunnerManager services: ProjectServiceManager snippets: ProjectSnippetManager + storage: "ProjectStorageManager" tags: ProjectTagManager triggers: ProjectTriggerManager users: ProjectUserManager @@ -1013,3 +1017,18 @@ class ProjectRemoteMirrorManager(ListMixin, CreateMixin, UpdateMixin, RESTManage required=("url",), optional=("enabled", "only_protected_branches") ) _update_attrs = RequiredOptional(optional=("enabled", "only_protected_branches")) + + +class ProjectStorage(RefreshMixin, RESTObject): + pass + + +class ProjectStorageManager(GetWithoutIdMixin, RESTManager): + _path = "/projects/{project_id}/storage" + _obj_cls = ProjectStorage + _from_parent_attrs = {"project_id": "id"} + + def get( + self, id: Optional[Union[int, str]] = None, **kwargs: Any + ) -> Optional[ProjectStorage]: + return cast(Optional[ProjectStorage], super().get(id=id, **kwargs)) |