1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import * # noqa
from gitlab.mixins import * # noqa
from .award_emojis import (
ProjectIssueNoteAwardEmojiManager,
ProjectMergeRequestNoteAwardEmojiManager,
ProjectSnippetNoteAwardEmojiManager,
)
__all__ = [
"ProjectNote",
"ProjectNoteManager",
"ProjectCommitDiscussionNote",
"ProjectCommitDiscussionNoteManager",
"ProjectIssueNote",
"ProjectIssueNoteManager",
"ProjectIssueDiscussionNote",
"ProjectIssueDiscussionNoteManager",
"ProjectMergeRequestNote",
"ProjectMergeRequestNoteManager",
"ProjectMergeRequestDiscussionNote",
"ProjectMergeRequestDiscussionNoteManager",
"ProjectSnippetNote",
"ProjectSnippetNoteManager",
"ProjectSnippetDiscussionNote",
"ProjectSnippetDiscussionNoteManager",
]
class ProjectNote(RESTObject):
pass
class ProjectNoteManager(RetrieveMixin, RESTManager):
_path = "/projects/%(project_id)s/notes"
_obj_cls = ProjectNote
_from_parent_attrs = {"project_id": "id"}
_create_attrs = (("body",), tuple())
class ProjectCommitDiscussionNote(SaveMixin, ObjectDeleteMixin, RESTObject):
pass
class ProjectCommitDiscussionNoteManager(
GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager
):
_path = (
"/projects/%(project_id)s/repository/commits/%(commit_id)s/"
"discussions/%(discussion_id)s/notes"
)
_obj_cls = ProjectCommitDiscussionNote
_from_parent_attrs = {
"project_id": "project_id",
"commit_id": "commit_id",
"discussion_id": "id",
}
_create_attrs = (("body",), ("created_at", "position"))
_update_attrs = (("body",), tuple())
class ProjectIssueNote(SaveMixin, ObjectDeleteMixin, RESTObject):
_managers = (("awardemojis", "ProjectIssueNoteAwardEmojiManager"),)
class ProjectIssueNoteManager(CRUDMixin, RESTManager):
_path = "/projects/%(project_id)s/issues/%(issue_iid)s/notes"
_obj_cls = ProjectIssueNote
_from_parent_attrs = {"project_id": "project_id", "issue_iid": "iid"}
_create_attrs = (("body",), ("created_at",))
_update_attrs = (("body",), tuple())
class ProjectIssueDiscussionNote(SaveMixin, ObjectDeleteMixin, RESTObject):
pass
class ProjectIssueDiscussionNoteManager(
GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager
):
_path = (
"/projects/%(project_id)s/issues/%(issue_iid)s/"
"discussions/%(discussion_id)s/notes"
)
_obj_cls = ProjectIssueDiscussionNote
_from_parent_attrs = {
"project_id": "project_id",
"issue_iid": "issue_iid",
"discussion_id": "id",
}
_create_attrs = (("body",), ("created_at",))
_update_attrs = (("body",), tuple())
class ProjectMergeRequestNote(SaveMixin, ObjectDeleteMixin, RESTObject):
_managers = (("awardemojis", "ProjectMergeRequestNoteAwardEmojiManager"),)
class ProjectMergeRequestNoteManager(CRUDMixin, RESTManager):
_path = "/projects/%(project_id)s/merge_requests/%(mr_iid)s/notes"
_obj_cls = ProjectMergeRequestNote
_from_parent_attrs = {"project_id": "project_id", "mr_iid": "iid"}
_create_attrs = (("body",), tuple())
_update_attrs = (("body",), tuple())
class ProjectMergeRequestDiscussionNote(SaveMixin, ObjectDeleteMixin, RESTObject):
pass
class ProjectMergeRequestDiscussionNoteManager(
GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager
):
_path = (
"/projects/%(project_id)s/merge_requests/%(mr_iid)s/"
"discussions/%(discussion_id)s/notes"
)
_obj_cls = ProjectMergeRequestDiscussionNote
_from_parent_attrs = {
"project_id": "project_id",
"mr_iid": "mr_iid",
"discussion_id": "id",
}
_create_attrs = (("body",), ("created_at",))
_update_attrs = (("body",), tuple())
class ProjectSnippetNote(SaveMixin, ObjectDeleteMixin, RESTObject):
_managers = (("awardemojis", "ProjectSnippetNoteAwardEmojiManager"),)
class ProjectSnippetNoteManager(CRUDMixin, RESTManager):
_path = "/projects/%(project_id)s/snippets/%(snippet_id)s/notes"
_obj_cls = ProjectSnippetNote
_from_parent_attrs = {"project_id": "project_id", "snippet_id": "id"}
_create_attrs = (("body",), tuple())
_update_attrs = (("body",), tuple())
class ProjectSnippetDiscussionNote(SaveMixin, ObjectDeleteMixin, RESTObject):
pass
class ProjectSnippetDiscussionNoteManager(
GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager
):
_path = (
"/projects/%(project_id)s/snippets/%(snippet_id)s/"
"discussions/%(discussion_id)s/notes"
)
_obj_cls = ProjectSnippetDiscussionNote
_from_parent_attrs = {
"project_id": "project_id",
"snippet_id": "snippet_id",
"discussion_id": "id",
}
_create_attrs = (("body",), ("created_at",))
_update_attrs = (("body",), tuple())
|