@@ -1358,6 +1358,34 @@ class ProjectLabel(GitlabObject):
1358
1358
requiredUpdateAttrs = ['name' ]
1359
1359
optionalUpdateAttrs = ['new_name' , 'color' , 'description' ]
1360
1360
1361
+ def subscribe (self , ** kwargs ):
1362
+ """Subscribe to a label.
1363
+
1364
+ Raises:
1365
+ GitlabConnectionError: If the server cannot be reached.
1366
+ GitlabSubscribeError: If the subscription cannot be done
1367
+ """
1368
+ url = ('/projects/%(project_id)s/labels/%(label_id)s/subscription' %
1369
+ {'project_id' : self .project_id , 'label_id' : self .name })
1370
+
1371
+ r = self .gitlab ._raw_post (url , ** kwargs )
1372
+ raise_error_from_response (r , GitlabSubscribeError , [201 , 304 ])
1373
+ self ._set_from_dict (r .json ())
1374
+
1375
+ def unsubscribe (self , ** kwargs ):
1376
+ """Unsubscribe a label.
1377
+
1378
+ Raises:
1379
+ GitlabConnectionError: If the server cannot be reached.
1380
+ GitlabSubscribeError: If the unsubscription cannot be done
1381
+ """
1382
+ url = ('/projects/%(project_id)s/labels/%(label_id)s/subscription' %
1383
+ {'project_id' : self .project_id , 'label_id' : self .name })
1384
+
1385
+ r = self .gitlab ._raw_delete (url , ** kwargs )
1386
+ raise_error_from_response (r , GitlabUnsubscribeError , [200 , 304 ])
1387
+ self ._set_from_dict (r .json ())
1388
+
1361
1389
1362
1390
class ProjectLabelManager (BaseManager ):
1363
1391
obj_cls = ProjectLabel
0 commit comments