@@ -1358,6 +1358,34 @@ class ProjectLabel(GitlabObject):
13581358 requiredUpdateAttrs = ['name' ]
13591359 optionalUpdateAttrs = ['new_name' , 'color' , 'description' ]
13601360
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+
13611389
13621390class ProjectLabelManager (BaseManager ):
13631391 obj_cls = ProjectLabel
0 commit comments