@@ -1159,10 +1159,39 @@ class ProjectCommitCommentManager(ListMixin, CreateMixin, RESTManager):
1159
1159
_create_attrs = (('note' , ), ('path' , 'line' , 'line_type' ))
1160
1160
1161
1161
1162
+ class ProjectCommitDiscussionNote (SaveMixin , ObjectDeleteMixin , RESTObject ):
1163
+ pass
1164
+
1165
+
1166
+ class ProjectCommitDiscussionNoteManager (GetMixin , CreateMixin , UpdateMixin ,
1167
+ DeleteMixin , RESTManager ):
1168
+ _path = ('/projects/%(project_id)s/repository/commits/%(commit_id)s/'
1169
+ 'discussions/%(discussion_id)s/notes' )
1170
+ _obj_cls = ProjectCommitDiscussionNote
1171
+ _from_parent_attrs = {'project_id' : 'project_id' ,
1172
+ 'commit_id' : 'commit_id' ,
1173
+ 'discussion_id' : 'id' }
1174
+ _create_attrs = (('body' ,), ('created_at' , 'position' ))
1175
+ _update_attrs = (('body' ,), tuple ())
1176
+
1177
+
1178
+ class ProjectCommitDiscussion (RESTObject ):
1179
+ _managers = (('notes' , 'ProjectCommitDiscussionNoteManager' ),)
1180
+
1181
+
1182
+ class ProjectCommitDiscussionManager (RetrieveMixin , CreateMixin , RESTManager ):
1183
+ _path = ('/projects/%(project_id)s/repository/commits/%(commit_id)s/'
1184
+ 'discussions' )
1185
+ _obj_cls = ProjectCommitDiscussion
1186
+ _from_parent_attrs = {'project_id' : 'project_id' , 'commit_id' : 'id' }
1187
+ _create_attrs = (('body' ,), ('created_at' ,))
1188
+
1189
+
1162
1190
class ProjectCommit (RESTObject ):
1163
1191
_short_print_attr = 'title'
1164
1192
_managers = (
1165
1193
('comments' , 'ProjectCommitCommentManager' ),
1194
+ ('discussions' , 'ProjectCommitDiscussionManager' ),
1166
1195
('statuses' , 'ProjectCommitStatusManager' ),
1167
1196
)
1168
1197
@@ -1330,13 +1359,41 @@ class ProjectIssueNoteManager(CRUDMixin, RESTManager):
1330
1359
_update_attrs = (('body' , ), tuple ())
1331
1360
1332
1361
1362
+ class ProjectIssueDiscussionNote (SaveMixin , ObjectDeleteMixin , RESTObject ):
1363
+ pass
1364
+
1365
+
1366
+ class ProjectIssueDiscussionNoteManager (GetMixin , CreateMixin , UpdateMixin ,
1367
+ DeleteMixin , RESTManager ):
1368
+ _path = ('/projects/%(project_id)s/issues/%(issue_iid)s/'
1369
+ 'discussions/%(discussion_id)s/notes' )
1370
+ _obj_cls = ProjectIssueDiscussionNote
1371
+ _from_parent_attrs = {'project_id' : 'project_id' ,
1372
+ 'issue_iid' : 'issue_iid' ,
1373
+ 'discussion_id' : 'id' }
1374
+ _create_attrs = (('body' ,), ('created_at' ,))
1375
+ _update_attrs = (('body' ,), tuple ())
1376
+
1377
+
1378
+ class ProjectIssueDiscussion (RESTObject ):
1379
+ _managers = (('notes' , 'ProjectIssueDiscussionNoteManager' ),)
1380
+
1381
+
1382
+ class ProjectIssueDiscussionManager (RetrieveMixin , CreateMixin , RESTManager ):
1383
+ _path = '/projects/%(project_id)s/issues/%(issue_iid)s/discussions'
1384
+ _obj_cls = ProjectIssueDiscussion
1385
+ _from_parent_attrs = {'project_id' : 'project_id' , 'issue_iid' : 'iid' }
1386
+ _create_attrs = (('body' ,), ('created_at' ,))
1387
+
1388
+
1333
1389
class ProjectIssue (SubscribableMixin , TodoMixin , TimeTrackingMixin , SaveMixin ,
1334
1390
ObjectDeleteMixin , RESTObject ):
1335
1391
_short_print_attr = 'title'
1336
1392
_id_attr = 'iid'
1337
1393
_managers = (
1338
- ('notes' , 'ProjectIssueNoteManager' ),
1339
1394
('awardemojis' , 'ProjectIssueAwardEmojiManager' ),
1395
+ ('discussions' , 'ProjectIssueDiscussionManager' ),
1396
+ ('notes' , 'ProjectIssueNoteManager' ),
1340
1397
)
1341
1398
1342
1399
@cli .register_custom_action ('ProjectIssue' )
@@ -1510,7 +1567,7 @@ class ProjectMergeRequestNoteAwardEmojiManager(NoUpdateMixin, RESTManager):
1510
1567
'/notes/%(note_id)s/award_emoji' )
1511
1568
_obj_cls = ProjectMergeRequestNoteAwardEmoji
1512
1569
_from_parent_attrs = {'project_id' : 'project_id' ,
1513
- 'mr_iid' : 'issue_iid ' ,
1570
+ 'mr_iid' : 'mr_iid ' ,
1514
1571
'note_id' : 'id' }
1515
1572
_create_attrs = (('name' , ), tuple ())
1516
1573
@@ -1527,13 +1584,45 @@ class ProjectMergeRequestNoteManager(CRUDMixin, RESTManager):
1527
1584
_update_attrs = (('body' , ), tuple ())
1528
1585
1529
1586
1587
+ class ProjectMergeRequestDiscussionNote (SaveMixin , ObjectDeleteMixin ,
1588
+ RESTObject ):
1589
+ pass
1590
+
1591
+
1592
+ class ProjectMergeRequestDiscussionNoteManager (GetMixin , CreateMixin ,
1593
+ UpdateMixin , DeleteMixin ,
1594
+ RESTManager ):
1595
+ _path = ('/projects/%(project_id)s/merge_requests/%(mr_iid)s/'
1596
+ 'discussions/%(discussion_id)s/notes' )
1597
+ _obj_cls = ProjectMergeRequestDiscussionNote
1598
+ _from_parent_attrs = {'project_id' : 'project_id' ,
1599
+ 'mr_iid' : 'mr_iid' ,
1600
+ 'discussion_id' : 'id' }
1601
+ _create_attrs = (('body' ,), ('created_at' ,))
1602
+ _update_attrs = (('body' ,), tuple ())
1603
+
1604
+
1605
+ class ProjectMergeRequestDiscussion (SaveMixin , RESTObject ):
1606
+ _managers = (('notes' , 'ProjectMergeRequestDiscussionNoteManager' ),)
1607
+
1608
+
1609
+ class ProjectMergeRequestDiscussionManager (RetrieveMixin , CreateMixin ,
1610
+ UpdateMixin , RESTManager ):
1611
+ _path = '/projects/%(project_id)s/merge_requests/%(mr_iid)s/discussions'
1612
+ _obj_cls = ProjectMergeRequestDiscussion
1613
+ _from_parent_attrs = {'project_id' : 'project_id' , 'mr_iid' : 'iid' }
1614
+ _create_attrs = (('body' ,), ('created_at' , 'position' ))
1615
+ _update_attrs = (('resolved' ,), tuple ())
1616
+
1617
+
1530
1618
class ProjectMergeRequest (SubscribableMixin , TodoMixin , TimeTrackingMixin ,
1531
1619
SaveMixin , ObjectDeleteMixin , RESTObject ):
1532
1620
_id_attr = 'iid'
1533
1621
1534
1622
_managers = (
1535
1623
('awardemojis' , 'ProjectMergeRequestAwardEmojiManager' ),
1536
1624
('diffs' , 'ProjectMergeRequestDiffManager' ),
1625
+ ('discussions' , 'ProjectMergeRequestDiscussionManager' ),
1537
1626
('notes' , 'ProjectMergeRequestNoteManager' ),
1538
1627
)
1539
1628
@@ -2175,11 +2264,39 @@ class ProjectSnippetAwardEmojiManager(NoUpdateMixin, RESTManager):
2175
2264
_create_attrs = (('name' , ), tuple ())
2176
2265
2177
2266
2267
+ class ProjectSnippetDiscussionNote (SaveMixin , ObjectDeleteMixin , RESTObject ):
2268
+ pass
2269
+
2270
+
2271
+ class ProjectSnippetDiscussionNoteManager (GetMixin , CreateMixin , UpdateMixin ,
2272
+ DeleteMixin , RESTManager ):
2273
+ _path = ('/projects/%(project_id)s/snippets/%(snippet_id)s/'
2274
+ 'discussions/%(discussion_id)s/notes' )
2275
+ _obj_cls = ProjectSnippetDiscussionNote
2276
+ _from_parent_attrs = {'project_id' : 'project_id' ,
2277
+ 'snippet_id' : 'snippet_id' ,
2278
+ 'discussion_id' : 'id' }
2279
+ _create_attrs = (('body' ,), ('created_at' ,))
2280
+ _update_attrs = (('body' ,), tuple ())
2281
+
2282
+
2283
+ class ProjectSnippetDiscussion (RESTObject ):
2284
+ _managers = (('notes' , 'ProjectSnippetDiscussionNoteManager' ),)
2285
+
2286
+
2287
+ class ProjectSnippetDiscussionManager (RetrieveMixin , CreateMixin , RESTManager ):
2288
+ _path = '/projects/%(project_id)s/snippets/%(snippet_id)s/discussions'
2289
+ _obj_cls = ProjectSnippetDiscussion
2290
+ _from_parent_attrs = {'project_id' : 'project_id' , 'snippet_id' : 'id' }
2291
+ _create_attrs = (('body' ,), ('created_at' ,))
2292
+
2293
+
2178
2294
class ProjectSnippet (SaveMixin , ObjectDeleteMixin , RESTObject ):
2179
2295
_url = '/projects/%(project_id)s/snippets'
2180
2296
_short_print_attr = 'title'
2181
2297
_managers = (
2182
2298
('awardemojis' , 'ProjectSnippetAwardEmojiManager' ),
2299
+ ('discussions' , 'ProjectSnippetDiscussionManager' ),
2183
2300
('notes' , 'ProjectSnippetNoteManager' ),
2184
2301
)
2185
2302
0 commit comments