@@ -1099,7 +1099,7 @@ def unsubscribe(self, **kwargs):
1099
1099
1100
1100
Raises:
1101
1101
GitlabConnectionError: If the server cannot be reached.
1102
- GitlabSubscribeError : If the unsubscription cannot be done
1102
+ GitlabUnsubscribeError : If the unsubscription cannot be done
1103
1103
"""
1104
1104
url = ('/projects/%(project_id)s/issues/%(issue_id)s/subscription' %
1105
1105
{'project_id' : self .project_id , 'issue_id' : self .id })
@@ -1249,6 +1249,36 @@ def _data_for_gitlab(self, extra_parameters={}, update=False):
1249
1249
data = json .dumps (d )
1250
1250
return data
1251
1251
1252
+ def subscribe (self , ** kwargs ):
1253
+ """Subscribe to a MR.
1254
+
1255
+ Raises:
1256
+ GitlabConnectionError: If the server cannot be reached.
1257
+ GitlabSubscribeError: If the subscription cannot be done
1258
+ """
1259
+ url = ('/projects/%(project_id)s/merge_requests/%(mr_id)s/'
1260
+ 'subscription' %
1261
+ {'project_id' : self .project_id , 'mr_id' : self .id })
1262
+
1263
+ r = self .gitlab ._raw_post (url , ** kwargs )
1264
+ raise_error_from_response (r , GitlabSubscribeError , [201 , 304 ])
1265
+ self ._set_from_dict (r .json ())
1266
+
1267
+ def unsubscribe (self , ** kwargs ):
1268
+ """Unsubscribe a MR.
1269
+
1270
+ Raises:
1271
+ GitlabConnectionError: If the server cannot be reached.
1272
+ GitlabUnsubscribeError: If the unsubscription cannot be done
1273
+ """
1274
+ url = ('/projects/%(project_id)s/merge_requests/%(mr_id)s/'
1275
+ 'subscription' %
1276
+ {'project_id' : self .project_id , 'mr_id' : self .id })
1277
+
1278
+ r = self .gitlab ._raw_delete (url , ** kwargs )
1279
+ raise_error_from_response (r , GitlabUnsubscribeError , [200 , 304 ])
1280
+ self ._set_from_dict (r .json ())
1281
+
1252
1282
def cancel_merge_when_build_succeeds (self , ** kwargs ):
1253
1283
"""Cancel merge when build succeeds."""
1254
1284
@@ -1377,7 +1407,7 @@ def unsubscribe(self, **kwargs):
1377
1407
1378
1408
Raises:
1379
1409
GitlabConnectionError: If the server cannot be reached.
1380
- GitlabSubscribeError : If the unsubscription cannot be done
1410
+ GitlabUnsubscribeError : If the unsubscription cannot be done
1381
1411
"""
1382
1412
url = ('/projects/%(project_id)s/labels/%(label_id)s/subscription' %
1383
1413
{'project_id' : self .project_id , 'label_id' : self .name })
0 commit comments