Repository navigation
Expand file tree
/
Copy pathNotifications.php
More file actions
144 lines (133 loc) · 3.95 KB
/
Copy pathNotifications.php
File metadata and controls
144 lines (133 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
namespace Github\Api\CurrentUser;
use Github\Api\AbstractApi;
/**
* @link http://developer.github.com/v3/activity/notifications/
* @author Joseph Bielawski <stloyd@gmail.com>
*/
class Notifications extends AbstractApi
{
/**
* List all notifications for the authenticated user.
*
* @link http://developer.github.com/v3/activity/notifications/#list-your-notifications
*
* @param array $params
*
* @return array
*/
public function all(array $params = array())
{
return $this->get('notifications', $params);
}
/**
* List all notifications for the authenticated user in selected repository.
*
* @link http://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository
*
* @param string $username the user who owns the repo
* @param string $repository the name of the repo
* @param array $params
*
* @return array
*/
public function allInRepository($username, $repository, array $params = array())
{
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params);
}
/**
* Mark all notifications as read.
*
* @link http://developer.github.com/v3/activity/notifications/#mark-as-read
*
* @param array $params
*
* @return array
*/
public function markAsReadAll(array $params = array())
{
return $this->put('notifications', $params);
}
/**
* Mark all notifications for a repository as read.
*
* @link http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository
*
* @param string $username the user who owns the repo
* @param string $repository the name of the repo
* @param array $params
*
* @return array
*/
public function markAsReadInRepository($username, $repository, array $params = array())
{
return $this->put('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params);
}
/**
* Mark a notification as read.
*
* @link http://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read
*
* @param string $id the notification number
* @param array $params
*
* @return array
*/
public function markAsRead($id, array $params)
{
return $this->patch('notifications/threads/'.rawurlencode($id), $params);
}
/**
* Show a notification.
*
* @link http://developer.github.com/v3/activity/notifications/#view-a-single-thread
*
* @param string $id the notification number
*
* @return array
*/
public function show($id)
{
return $this->get('notifications/threads/'.rawurlencode($id));
}
/**
* Show a subscription.
*
* @link http://developer.github.com/v3/activity/notifications/#get-a-thread-subscription
*
* @param string $id the notification number
*
* @return array
*/
public function showSubscription($id)
{
return $this->get('notifications/threads/'.rawurlencode($id).'/subscription');
}
/**
* Create a subscription.
*
* @link http://developer.github.com/v3/activity/notifications/#set-a-thread-subscription
*
* @param string $id the notification number
* @param array $params
*
* @return array
*/
public function createSubscription($id, array $params)
{
return $this->put('notifications/threads/'.rawurlencode($id).'/subscription', $params);
}
/**
* Delete a subscription.
*
* @link http://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription
*
* @param string $id the notification number
*
* @return array
*/
public function removeSubscription($id)
{
return $this->delete('notifications/threads/'.rawurlencode($id).'/subscription');
}
}