diff options
Diffstat (limited to 'gitlab/v4/objects/deploy_keys.py')
-rw-r--r-- | gitlab/v4/objects/deploy_keys.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/gitlab/v4/objects/deploy_keys.py b/gitlab/v4/objects/deploy_keys.py deleted file mode 100644 index cf0507d..0000000 --- a/gitlab/v4/objects/deploy_keys.py +++ /dev/null @@ -1,48 +0,0 @@ -from gitlab import cli -from gitlab import exceptions as exc -from gitlab.base import RequiredOptional, RESTManager, RESTObject -from gitlab.mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin - -__all__ = [ - "DeployKey", - "DeployKeyManager", - "ProjectKey", - "ProjectKeyManager", -] - - -class DeployKey(RESTObject): - pass - - -class DeployKeyManager(ListMixin, RESTManager): - _path = "/deploy_keys" - _obj_cls = DeployKey - - -class ProjectKey(SaveMixin, ObjectDeleteMixin, RESTObject): - pass - - -class ProjectKeyManager(CRUDMixin, RESTManager): - _path = "/projects/%(project_id)s/deploy_keys" - _obj_cls = ProjectKey - _from_parent_attrs = {"project_id": "id"} - _create_attrs = RequiredOptional(required=("title", "key"), optional=("can_push",)) - _update_attrs = RequiredOptional(optional=("title", "can_push")) - - @cli.register_custom_action("ProjectKeyManager", ("key_id",)) - @exc.on_http_error(exc.GitlabProjectDeployKeyError) - def enable(self, key_id, **kwargs): - """Enable a deploy key for a project. - - Args: - key_id (int): The ID of the key to enable - **kwargs: Extra options to send to the server (e.g. sudo) - - Raises: - GitlabAuthenticationError: If authentication is not correct - GitlabProjectDeployKeyError: If the key could not be enabled - """ - path = "%s/%s/enable" % (self.path, key_id) - self.gitlab.http_post(path, **kwargs) |