| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,14 +4,20 @@ | |||
| 4 | 4 | Notes | |
| 5 | 5 | ##### | |
| 6 | 6 | ||
| 7 | - You can manipulate notes (comments) on project issues, merge requests and | ||
| 7 | + You can manipulate notes (comments) on group epics, project issues, merge requests and | ||
| 8 | 8 | snippets. | |
| 9 | 9 | ||
| 10 | 10 | Reference | |
| 11 | 11 | --------- | |
| 12 | 12 | ||
| 13 | 13 | * v4 API: | |
| 14 | 14 | ||
| 15 | + Epics: | ||
| 16 | + | ||
| 17 | + * :class:`gitlab.v4.objects.GroupEpicNote` | ||
| 18 | + * :class:`gitlab.v4.objects.GroupEpicNoteManager` | ||
| 19 | + * :attr:`gitlab.v4.objects.GroupEpic.notes` | ||
| 20 | + | ||
| 15 | 21 | Issues: | |
| 16 | 22 | ||
| 17 | 23 | + :class:`gitlab.v4.objects.ProjectIssueNote` | |
@@ -37,18 +43,21 @@ Examples | |||
| 37 | 43 | ||
| 38 | 44 | List the notes for a resource:: | |
| 39 | 45 | ||
| 46 | + e_notes = epic.notes.list() | ||
| 40 | 47 | i_notes = issue.notes.list() | |
| 41 | 48 | mr_notes = mr.notes.list() | |
| 42 | 49 | s_notes = snippet.notes.list() | |
| 43 | 50 | ||
| 44 | 51 | Get a note for a resource:: | |
| 45 | 52 | ||
| 53 | + e_note = epic.notes.get(note_id) | ||
| 46 | 54 | i_note = issue.notes.get(note_id) | |
| 47 | 55 | mr_note = mr.notes.get(note_id) | |
| 48 | 56 | s_note = snippet.notes.get(note_id) | |
| 49 | 57 | ||
| 50 | 58 | Create a note for a resource:: | |
| 51 | 59 | ||
| 60 | + e_note = epic.notes.create({'body': 'note content'}) | ||
| 52 | 61 | i_note = issue.notes.create({'body': 'note content'}) | |
| 53 | 62 | mr_note = mr.notes.create({'body': 'note content'}) | |
| 54 | 63 | s_note = snippet.notes.create({'body': 'note content'}) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,10 @@ | |||
| 4 | 4 | from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin | |
| 5 | 5 | ||
| 6 | 6 | __all__ = [ | |
| 7 | + "GroupEpicAwardEmoji", | ||
| 8 | + "GroupEpicAwardEmojiManager", | ||
| 9 | + "GroupEpicNoteAwardEmoji", | ||
| 10 | + "GroupEpicNoteAwardEmojiManager", | ||
| 7 | 11 | "ProjectIssueAwardEmoji", | |
| 8 | 12 | "ProjectIssueAwardEmojiManager", | |
| 9 | 13 | "ProjectIssueNoteAwardEmoji", | |
@@ -19,6 +23,42 @@ | |||
| 19 | 23 | ] | |
| 20 | 24 | ||
| 21 | 25 | ||
| 26 | + class GroupEpicAwardEmoji(ObjectDeleteMixin, RESTObject): | ||
| 27 | + pass | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + class GroupEpicAwardEmojiManager(NoUpdateMixin, RESTManager): | ||
| 31 | + _path = "/groups/{group_id}/epics/{epic_iid}/award_emoji" | ||
| 32 | + _obj_cls = GroupEpicAwardEmoji | ||
| 33 | + _from_parent_attrs = {"group_id": "group_id", "epic_iid": "iid"} | ||
| 34 | + _create_attrs = RequiredOptional(required=("name",)) | ||
| 35 | + | ||
| 36 | + def get( | ||
| 37 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 38 | + ) -> GroupEpicAwardEmoji: | ||
| 39 | + return cast(GroupEpicAwardEmoji, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + class GroupEpicNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | ||
| 43 | + pass | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + class GroupEpicNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | ||
| 47 | + _path = "/groups/{group_id}/epics/{epic_iid}/notes/{note_id}/award_emoji" | ||
| 48 | + _obj_cls = GroupEpicNoteAwardEmoji | ||
| 49 | + _from_parent_attrs = { | ||
| 50 | + "group_id": "group_id", | ||
| 51 | + "epic_iid": "epic_iid", | ||
| 52 | + "note_id": "id", | ||
| 53 | + } | ||
| 54 | + _create_attrs = RequiredOptional(required=("name",)) | ||
| 55 | + | ||
| 56 | + def get( | ||
| 57 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 58 | + ) -> GroupEpicNoteAwardEmoji: | ||
| 59 | + return cast(GroupEpicNoteAwardEmoji, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 60 | + | ||
| 61 | + | ||
| 22 | 62 | class ProjectIssueAwardEmoji(ObjectDeleteMixin, RESTObject): | |
| 23 | 63 | pass | |
| 24 | 64 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,12 +13,17 @@ | |||
| 13 | 13 | ) | |
| 14 | 14 | ||
| 15 | 15 | from .award_emojis import ( # noqa: F401 | |
| 16 | + GroupEpicNoteAwardEmojiManager, | ||
| 16 | 17 | ProjectIssueNoteAwardEmojiManager, | |
| 17 | 18 | ProjectMergeRequestNoteAwardEmojiManager, | |
| 18 | 19 | ProjectSnippetNoteAwardEmojiManager, | |
| 19 | 20 | ) | |
| 20 | 21 | ||
| 21 | 22 | __all__ = [ | |
| 23 | + "GroupEpicNote", | ||
| 24 | + "GroupEpicNoteManager", | ||
| 25 | + "GroupEpicDiscussionNote", | ||
| 26 | + "GroupEpicDiscussionNoteManager", | ||
| 22 | 27 | "ProjectNote", | |
| 23 | 28 | "ProjectNoteManager", | |
| 24 | 29 | "ProjectCommitDiscussionNote", | |
@@ -38,6 +43,46 @@ | |||
| 38 | 43 | ] | |
| 39 | 44 | ||
| 40 | 45 | ||
| 46 | + class GroupEpicNote(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
| 47 | + awardemojis: GroupEpicNoteAwardEmojiManager | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + class GroupEpicNoteManager(CRUDMixin, RESTManager): | ||
| 51 | + _path = "/groups/{group_id}/epics/{epic_iid}/notes" | ||
| 52 | + _obj_cls = GroupEpicNote | ||
| 53 | + _from_parent_attrs = {"group_id": "group_id", "epic_iid": "iid"} | ||
| 54 | + _create_attrs = RequiredOptional(required=("body",), optional=("created_at",)) | ||
| 55 | + _update_attrs = RequiredOptional(required=("body",)) | ||
| 56 | + | ||
| 57 | + def get( | ||
| 58 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 59 | + ) -> GroupEpicNote: | ||
| 60 | + return cast(GroupEpicNote, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 61 | + | ||
| 62 | + | ||
| 63 | + class GroupEpicDiscussionNote(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
| 64 | + pass | ||
| 65 | + | ||
| 66 | + | ||
| 67 | + class GroupEpicDiscussionNoteManager( | ||
| 68 | + GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager | ||
| 69 | + ): | ||
| 70 | + _path = "/groups/{group_id}/epics/{epic_iid}/discussions/{discussion_id}/notes" | ||
| 71 | + _obj_cls = GroupEpicDiscussionNote | ||
| 72 | + _from_parent_attrs = { | ||
| 73 | + "group_id": "group_id", | ||
| 74 | + "epic_iid": "epic_iid", | ||
| 75 | + "discussion_id": "id", | ||
| 76 | + } | ||
| 77 | + _create_attrs = RequiredOptional(required=("body",), optional=("created_at",)) | ||
| 78 | + _update_attrs = RequiredOptional(required=("body",)) | ||
| 79 | + | ||
| 80 | + def get( | ||
| 81 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 82 | + ) -> GroupEpicDiscussionNote: | ||
| 83 | + return cast(GroupEpicDiscussionNote, super().get(id=id, lazy=lazy, **kwargs)) | ||
| 84 | + | ||
| 85 | + | ||
| 41 | 86 | class ProjectNote(RESTObject): | |
| 42 | 87 | pass | |
| 43 | 88 | ||
@@ -172,7 +217,7 @@ def get( | |||
| 172 | 217 | ||
| 173 | 218 | ||
| 174 | 219 | class ProjectSnippetNote(SaveMixin, ObjectDeleteMixin, RESTObject): | |
| 175 | - awardemojis: ProjectMergeRequestNoteAwardEmojiManager | ||
| 220 | + awardemojis: ProjectSnippetNoteAwardEmojiManager | ||
| 176 | 221 | ||
| 177 | 222 | ||
| 178 | 223 | class ProjectSnippetNoteManager(CRUDMixin, RESTManager): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments