@@ -2423,21 +2423,14 @@ def subscribe(self):
2423
2423
2424
2424
This replaces ``Repository#set_subscription``
2425
2425
2426
- :param bool subscribed:
2427
- (required), determines if notifications should
2428
- be received from this repository.
2429
- :param bool ignored:
2430
- (required), determines if notifications should be
2431
- ignored from this repository.
2432
2426
:returns:
2433
2427
the new repository subscription
2434
2428
:rtype:
2435
2429
:class:`~github3.notifications.RepositorySubscription`
2436
2430
"""
2437
2431
url = self ._build_url ("subscription" , base_url = self ._api )
2438
2432
json = self ._json (
2439
- self ._put (url , data = jsonlib .dumps ({"subcribed" : True })), 200
2440
- )
2433
+ self ._put (url , data = jsonlib .dumps ({"subscribed" : True })), 200 )
2441
2434
return self ._instance_or_null (
2442
2435
notifications .RepositorySubscription , json
2443
2436
)
@@ -2557,6 +2550,47 @@ def tree(self, sha, recursive=False):
2557
2550
json = self ._json (self ._get (url , params = params ), 200 )
2558
2551
return self ._instance_or_null (git .Tree , json )
2559
2552
2553
+ @requires_auth
2554
+ def unignore (self ):
2555
+ """Unignore notifications from this repository for the user.
2556
+
2557
+ .. versionadded:: 1.3
2558
+
2559
+ This replaces ``Repository#set_subscription``.
2560
+
2561
+ :returns:
2562
+ the new repository subscription
2563
+ :rtype:
2564
+ :class:~github3.notifications.RepositorySubscription`
2565
+ """
2566
+ url = self ._build_url ("subscription" , base_url = self ._api )
2567
+ json = self ._json (
2568
+ self ._put (url , data = jsonlib .dumps ({"ignored" : False })), 200
2569
+ )
2570
+ return self ._instance_or_null (
2571
+ notifications .RepositorySubscription , json
2572
+ )
2573
+
2574
+ @requires_auth
2575
+ def unsubscribe (self ):
2576
+ """Unsubscribe the user to this repository's notifications.
2577
+
2578
+ .. versionadded:: 1.3
2579
+
2580
+ This replaces ``Repository#set_subscription``
2581
+
2582
+ :returns:
2583
+ the new repository subscription
2584
+ :rtype:
2585
+ :class:`~github3.notifications.RepositorySubscription`
2586
+ """
2587
+ url = self ._build_url ("subscription" , base_url = self ._api )
2588
+ json = self ._json (
2589
+ self ._put (url , data = jsonlib .dumps ({"subscribed" : False })), 200 )
2590
+ return self ._instance_or_null (
2591
+ notifications .RepositorySubscription , json
2592
+ )
2593
+
2560
2594
def weekly_commit_count (self ):
2561
2595
"""Retrieve the total commit counts.
2562
2596
0 commit comments