diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-11-17 18:34:10 +0100 |
|---|---|---|
| committer | John Villalovos <john@sodarock.com> | 2022-11-17 14:39:05 -0800 |
| commit | 0c98b2d8f4b8c1ac6a4b496282f307687b652759 (patch) | |
| tree | ccf45b0379cd07526ad536732b4232dd47c98a44 /gitlab/v4 | |
| parent | ad7c8fafd56866002aa6723ceeba4c4bc071ca0d (diff) | |
| download | gitlab-0c98b2d8f4b8c1ac6a4b496282f307687b652759.tar.gz | |
refactor: explicitly use ProjectSecureFile
Diffstat (limited to 'gitlab/v4')
| -rw-r--r-- | gitlab/v4/objects/projects.py | 4 | ||||
| -rw-r--r-- | gitlab/v4/objects/secure_files.py | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index fad21eb..e030965 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -82,7 +82,7 @@ from .push_rules import ProjectPushRulesManager # noqa: F401 from .releases import ProjectReleaseManager # noqa: F401 from .repositories import RepositoryMixin from .runners import ProjectRunnerManager # noqa: F401 -from .secure_files import SecureFileManager # noqa: F401 +from .secure_files import ProjectSecureFileManager # noqa: F401 from .snippets import ProjectSnippetManager # noqa: F401 from .statistics import ( # noqa: F401 ProjectAdditionalStatisticsManager, @@ -210,7 +210,7 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO remote_mirrors: "ProjectRemoteMirrorManager" repositories: ProjectRegistryRepositoryManager runners: ProjectRunnerManager - secure_files: SecureFileManager + secure_files: ProjectSecureFileManager services: ProjectServiceManager snippets: ProjectSnippetManager storage: "ProjectStorageManager" diff --git a/gitlab/v4/objects/secure_files.py b/gitlab/v4/objects/secure_files.py index ce8d12d..a7da5ea 100644 --- a/gitlab/v4/objects/secure_files.py +++ b/gitlab/v4/objects/secure_files.py @@ -13,11 +13,11 @@ from gitlab.base import RESTManager, RESTObject from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin from gitlab.types import FileAttribute, RequiredOptional -__all__ = ["SecureFile", "SecureFileManager"] +__all__ = ["ProjectSecureFile", "ProjectSecureFileManager"] -class SecureFile(ObjectDeleteMixin, RESTObject): - @cli.register_custom_action("SecureFile") +class ProjectSecureFile(ObjectDeleteMixin, RESTObject): + @cli.register_custom_action("ProjectSecureFile") @exc.on_http_error(exc.GitlabGetError) def download( self, @@ -58,12 +58,14 @@ class SecureFile(ObjectDeleteMixin, RESTObject): ) -class SecureFileManager(NoUpdateMixin, RESTManager): +class ProjectSecureFileManager(NoUpdateMixin, RESTManager): _path = "/projects/{project_id}/secure_files" - _obj_cls = SecureFile + _obj_cls = ProjectSecureFile _from_parent_attrs = {"project_id": "id"} _create_attrs = RequiredOptional(required=("name", "file")) _types = {"file": FileAttribute} - def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> SecureFile: - return cast(SecureFile, super().get(id=id, lazy=lazy, **kwargs)) + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> ProjectSecureFile: + return cast(ProjectSecureFile, super().get(id=id, lazy=lazy, **kwargs)) |
