@@ -1344,6 +1344,34 @@ class ProjectLabel(GitlabObject):
13441344 requiredUpdateAttrs = ['name' ]
13451345 optionalUpdateAttrs = ['new_name' , 'color' , 'description' ]
13461346
1347+ def subscribe (self , ** kwargs ):
1348+ """Subscribe to a label.
1349+
1350+ Raises:
1351+ GitlabConnectionError: If the server cannot be reached.
1352+ GitlabSubscribeError: If the subscription cannot be done
1353+ """
1354+ url = ('/projects/%(project_id)s/labels/%(label_id)s/subscription' %
1355+ {'project_id' : self .project_id , 'label_id' : self .name })
1356+
1357+ r = self .gitlab ._raw_post (url , ** kwargs )
1358+ raise_error_from_response (r , GitlabSubscribeError , [201 , 304 ])
1359+ self ._set_from_dict (r .json ())
1360+
1361+ def unsubscribe (self , ** kwargs ):
1362+ """Unsubscribe a label.
1363+
1364+ Raises:
1365+ GitlabConnectionError: If the server cannot be reached.
1366+ GitlabSubscribeError: If the unsubscription 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_delete (url , ** kwargs )
1372+ raise_error_from_response (r , GitlabUnsubscribeError , [200 , 304 ])
1373+ self ._set_from_dict (r .json ())
1374+
13471375
13481376class ProjectLabelManager (BaseManager ):
13491377 obj_cls = ProjectLabel
0 commit comments