summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/releases.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-02-21 12:01:33 +0100
committerNejc Habjan <hab.nejc@gmail.com>2021-02-21 12:01:33 +0100
commit28d751811ffda45ff0b1c35e0599b655f3a5a68b (patch)
tree62d6990b1037fdc94be07469e84926b2a204171d /gitlab/v4/objects/releases.py
parent649385cc03065d023d74399237331d1ea64f766f (diff)
downloadgitlab-28d751811ffda45ff0b1c35e0599b655f3a5a68b.tar.gz
feat(objects): add Release Links API support
Diffstat (limited to 'gitlab/v4/objects/releases.py')
-rw-r--r--gitlab/v4/objects/releases.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/gitlab/v4/objects/releases.py b/gitlab/v4/objects/releases.py
new file mode 100644
index 0000000..d9112e4
--- /dev/null
+++ b/gitlab/v4/objects/releases.py
@@ -0,0 +1,36 @@
+from gitlab import cli
+from gitlab import exceptions as exc
+from gitlab.base import * # noqa
+from gitlab.mixins import * # noqa
+
+
+__all__ = [
+ "ProjectRelease",
+ "ProjectReleaseManager",
+ "ProjectReleaseLink",
+ "ProjectReleaseLinkManager",
+]
+
+
+class ProjectRelease(RESTObject):
+ _id_attr = "tag_name"
+ _managers = (("links", "ProjectReleaseLinkManager"),)
+
+
+class ProjectReleaseManager(NoUpdateMixin, RESTManager):
+ _path = "/projects/%(project_id)s/releases"
+ _obj_cls = ProjectRelease
+ _from_parent_attrs = {"project_id": "id"}
+ _create_attrs = (("name", "tag_name", "description"), ("ref", "assets"))
+
+
+class ProjectReleaseLink(RESTObject, ObjectDeleteMixin, SaveMixin):
+ pass
+
+
+class ProjectReleaseLinkManager(CRUDMixin, RESTManager):
+ _path = "/projects/%(project_id)s/releases/%(tag_name)s/assets/links"
+ _obj_cls = ProjectReleaseLink
+ _from_parent_attrs = {"project_id": "project_id", "tag_name": "tag_name"}
+ _create_attrs = (("name", "url"), ("filepath", "link_type"))
+ _update_attrs = ((), ("name", "url", "filepath", "link_type"))