| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2167409 commit b33265c
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,7 @@ API examples | |||
| 6 | 6 | :maxdepth: 1 | |
| 7 | 7 | ||
| 8 | 8 | gl_objects/access_requests | |
| 9 | + gl_objects/emojis | ||
| 9 | 10 | gl_objects/branches | |
| 10 | 11 | gl_objects/protected_branches | |
| 11 | 12 | gl_objects/messages | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1091,10 +1091,35 @@ class ProjectHookManager(CRUDMixin, RESTManager): | |||
| 1091 | 1091 | ) | |
| 1092 | 1092 | ||
| 1093 | 1093 | ||
| 1094 | - class ProjectIssueNote(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
| 1094 | + class ProjectIssueAwardEmoji(ObjectDeleteMixin, RESTObject): | ||
| 1095 | 1095 | pass | |
| 1096 | 1096 | ||
| 1097 | 1097 | ||
| 1098 | + class ProjectIssueAwardEmojiManager(NoUpdateMixin, RESTManager): | ||
| 1099 | + _path = '/projects/%(project_id)s/issues/%(issue_iid)s/award_emoji' | ||
| 1100 | + _obj_cls = ProjectIssueAwardEmoji | ||
| 1101 | + _from_parent_attrs = {'project_id': 'project_id', 'issue_iid': 'iid'} | ||
| 1102 | + _create_attrs = (('name', ), tuple()) | ||
| 1103 | + | ||
| 1104 | + | ||
| 1105 | + class ProjectIssueNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | ||
| 1106 | + pass | ||
| 1107 | + | ||
| 1108 | + | ||
| 1109 | + class ProjectIssueNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | ||
| 1110 | + _path = ('/projects/%(project_id)s/issues/%(issue_iid)s' | ||
| 1111 | + '/notes/%(note_id)s/award_emoji') | ||
| 1112 | + _obj_cls = ProjectIssueNoteAwardEmoji | ||
| 1113 | + _from_parent_attrs = {'project_id': 'project_id', | ||
| 1114 | + 'issue_iid': 'issue_iid', | ||
| 1115 | + 'note_id': 'id'} | ||
| 1116 | + _create_attrs = (('name', ), tuple()) | ||
| 1117 | + | ||
| 1118 | + | ||
| 1119 | + class ProjectIssueNote(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
| 1120 | + _managers = (('awardemojis', 'ProjectIssueNoteAwardEmojiManager'),) | ||
| 1121 | + | ||
| 1122 | + | ||
| 1098 | 1123 | class ProjectIssueNoteManager(CRUDMixin, RESTManager): | |
| 1099 | 1124 | _path = '/projects/%(project_id)s/issues/%(issue_iid)s/notes' | |
| 1100 | 1125 | _obj_cls = ProjectIssueNote | |
@@ -1107,7 +1132,10 @@ class ProjectIssue(SubscribableMixin, TodoMixin, TimeTrackingMixin, SaveMixin, | |||
| 1107 | 1132 | ObjectDeleteMixin, RESTObject): | |
| 1108 | 1133 | _short_print_attr = 'title' | |
| 1109 | 1134 | _id_attr = 'iid' | |
| 1110 | - _managers = (('notes', 'ProjectIssueNoteManager'), ) | ||
| 1135 | + _managers = ( | ||
| 1136 | + ('notes', 'ProjectIssueNoteManager'), | ||
| 1137 | + ('awardemojis', 'ProjectIssueAwardEmojiManager'), | ||
| 1138 | + ) | ||
| 1111 | 1139 | ||
| 1112 | 1140 | @cli.register_custom_action('ProjectIssue') | |
| 1113 | 1141 | @exc.on_http_error(exc.GitlabUpdateError) | |
@@ -1243,6 +1271,17 @@ class ProjectTagManager(NoUpdateMixin, RESTManager): | |||
| 1243 | 1271 | _create_attrs = (('tag_name', 'ref'), ('message',)) | |
| 1244 | 1272 | ||
| 1245 | 1273 | ||
| 1274 | + class ProjectMergeRequestAwardEmoji(ObjectDeleteMixin, RESTObject): | ||
| 1275 | + pass | ||
| 1276 | + | ||
| 1277 | + | ||
| 1278 | + class ProjectMergeRequestAwardEmojiManager(NoUpdateMixin, RESTManager): | ||
| 1279 | + _path = '/projects/%(project_id)s/merge_requests/%(mr_iid)s/award_emoji' | ||
| 1280 | + _obj_cls = ProjectMergeRequestAwardEmoji | ||
| 1281 | + _from_parent_attrs = {'project_id': 'project_id', 'mr_iid': 'iid'} | ||
| 1282 | + _create_attrs = (('name', ), tuple()) | ||
| 1283 | + | ||
| 1284 | + | ||
| 1246 | 1285 | class ProjectMergeRequestDiff(RESTObject): | |
| 1247 | 1286 | pass | |
| 1248 | 1287 | ||
@@ -1253,10 +1292,24 @@ class ProjectMergeRequestDiffManager(RetrieveMixin, RESTManager): | |||
| 1253 | 1292 | _from_parent_attrs = {'project_id': 'project_id', 'mr_iid': 'iid'} | |
| 1254 | 1293 | ||
| 1255 | 1294 | ||
| 1256 | - class ProjectMergeRequestNote(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
| 1295 | + class ProjectMergeRequestNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | ||
| 1257 | 1296 | pass | |
| 1258 | 1297 | ||
| 1259 | 1298 | ||
| 1299 | + class ProjectMergeRequestNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | ||
| 1300 | + _path = ('/projects/%(project_id)s/merge_requests/%(mr_iid)s' | ||
| 1301 | + '/notes/%(note_id)s/award_emoji') | ||
| 1302 | + _obj_cls = ProjectMergeRequestNoteAwardEmoji | ||
| 1303 | + _from_parent_attrs = {'project_id': 'project_id', | ||
| 1304 | + 'mr_iid': 'issue_iid', | ||
| 1305 | + 'note_id': 'id'} | ||
| 1306 | + _create_attrs = (('name', ), tuple()) | ||
| 1307 | + | ||
| 1308 | + | ||
| 1309 | + class ProjectMergeRequestNote(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
| 1310 | + _managers = (('awardemojis', 'ProjectMergeRequestNoteAwardEmojiManager'),) | ||
| 1311 | + | ||
| 1312 | + | ||
| 1260 | 1313 | class ProjectMergeRequestNoteManager(CRUDMixin, RESTManager): | |
| 1261 | 1314 | _path = '/projects/%(project_id)s/merge_requests/%(mr_iid)s/notes' | |
| 1262 | 1315 | _obj_cls = ProjectMergeRequestNote | |
@@ -1270,8 +1323,9 @@ class ProjectMergeRequest(SubscribableMixin, TodoMixin, TimeTrackingMixin, | |||
| 1270 | 1323 | _id_attr = 'iid' | |
| 1271 | 1324 | ||
| 1272 | 1325 | _managers = ( | |
| 1326 | + ('awardemojis', 'ProjectMergeRequestAwardEmojiManager'), | ||
| 1327 | + ('diffs', 'ProjectMergeRequestDiffManager'), | ||
| 1273 | 1328 | ('notes', 'ProjectMergeRequestNoteManager'), | |
| 1274 | - ('diffs', 'ProjectMergeRequestDiffManager') | ||
| 1275 | 1329 | ) | |
| 1276 | 1330 | ||
| 1277 | 1331 | @cli.register_custom_action('ProjectMergeRequest') | |
@@ -1764,10 +1818,24 @@ def create(self, data, **kwargs): | |||
| 1764 | 1818 | return CreateMixin.create(self, data, path=path, **kwargs) | |
| 1765 | 1819 | ||
| 1766 | 1820 | ||
| 1767 | - class ProjectSnippetNote(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
| 1821 | + class ProjectSnippetNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | ||
| 1768 | 1822 | pass | |
| 1769 | 1823 | ||
| 1770 | 1824 | ||
| 1825 | + class ProjectSnippetNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | ||
| 1826 | + _path = ('/projects/%(project_id)s/snippets/%(snippet_id)s' | ||
| 1827 | + '/notes/%(note_id)s/award_emoji') | ||
| 1828 | + _obj_cls = ProjectSnippetNoteAwardEmoji | ||
| 1829 | + _from_parent_attrs = {'project_id': 'project_id', | ||
| 1830 | + 'snippet_id': 'snippet_id', | ||
| 1831 | + 'note_id': 'id'} | ||
| 1832 | + _create_attrs = (('name', ), tuple()) | ||
| 1833 | + | ||
| 1834 | + | ||
| 1835 | + class ProjectSnippetNote(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
| 1836 | + _managers = (('awardemojis', 'ProjectSnippetNoteAwardEmojiManager'),) | ||
| 1837 | + | ||
| 1838 | + | ||
| 1771 | 1839 | class ProjectSnippetNoteManager(CRUDMixin, RESTManager): | |
| 1772 | 1840 | _path = '/projects/%(project_id)s/snippets/%(snippet_id)s/notes' | |
| 1773 | 1841 | _obj_cls = ProjectSnippetNote | |
@@ -1777,10 +1845,24 @@ class ProjectSnippetNoteManager(CRUDMixin, RESTManager): | |||
| 1777 | 1845 | _update_attrs = (('body', ), tuple()) | |
| 1778 | 1846 | ||
| 1779 | 1847 | ||
| 1848 | + class ProjectSnippetAwardEmoji(ObjectDeleteMixin, RESTObject): | ||
| 1849 | + pass | ||
| 1850 | + | ||
| 1851 | + | ||
| 1852 | + class ProjectSnippetAwardEmojiManager(NoUpdateMixin, RESTManager): | ||
| 1853 | + _path = '/projects/%(project_id)s/snippets/%(snippet_id)s/award_emoji' | ||
| 1854 | + _obj_cls = ProjectSnippetAwardEmoji | ||
| 1855 | + _from_parent_attrs = {'project_id': 'project_id', 'snippet_id': 'id'} | ||
| 1856 | + _create_attrs = (('name', ), tuple()) | ||
| 1857 | + | ||
| 1858 | + | ||
| 1780 | 1859 | class ProjectSnippet(SaveMixin, ObjectDeleteMixin, RESTObject): | |
| 1781 | 1860 | _url = '/projects/%(project_id)s/snippets' | |
| 1782 | 1861 | _short_print_attr = 'title' | |
| 1783 | - _managers = (('notes', 'ProjectSnippetNoteManager'), ) | ||
| 1862 | + _managers = ( | ||
| 1863 | + ('awardemojis', 'ProjectSnippetAwardEmojiManager'), | ||
| 1864 | + ('notes', 'ProjectSnippetNoteManager'), | ||
| 1865 | + ) | ||
| 1784 | 1866 | ||
| 1785 | 1867 | @cli.register_custom_action('ProjectSnippet') | |
| 1786 | 1868 | @exc.on_http_error(exc.GitlabGetError) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -436,6 +436,10 @@ | |||
| 436 | 436 | assert(m1.issues().next().title == 'my issue 1') | |
| 437 | 437 | note = issue1.notes.create({'body': 'This is an issue note'}) | |
| 438 | 438 | assert(len(issue1.notes.list()) == 1) | |
| 439 | + emoji = note.awardemojis.create({'name': 'tractor'}) | ||
| 440 | + assert(len(note.awardemojis.list()) == 1) | ||
| 441 | + emoji.delete() | ||
| 442 | + assert(len(note.awardemojis.list()) == 0) | ||
| 439 | 443 | note.delete() | |
| 440 | 444 | assert(len(issue1.notes.list()) == 0) | |
| 441 | 445 | assert(isinstance(issue1.user_agent_detail(), dict)) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments