1 | <?php |
||
25 | class Users extends AbstractResource |
||
26 | { |
||
27 | /** |
||
28 | * @var array|null |
||
29 | */ |
||
30 | private $currentUser; |
||
31 | |||
32 | /** |
||
33 | * Returns the current user logged in. |
||
34 | * |
||
35 | * @return array |
||
36 | * @throws \RuntimeException |
||
37 | * @throws \InvalidArgumentException |
||
38 | * @throws \Throwable |
||
39 | * @throws \Exception |
||
40 | */ |
||
41 | public function current(): array |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | * @throws \Throwable |
||
59 | * @throws \RuntimeException |
||
60 | * @throws \Exception |
||
61 | * @throws \InvalidArgumentException |
||
62 | */ |
||
63 | public function currentUserId(): string |
||
67 | |||
68 | /** |
||
69 | * List of Rooms the user is part of. |
||
70 | * |
||
71 | * @param string|null $userId User id |
||
72 | * @return array |
||
73 | * @throws \RuntimeException |
||
74 | * @throws \InvalidArgumentException |
||
75 | * @throws \Throwable |
||
76 | * @throws \Exception |
||
77 | */ |
||
78 | public function rooms(string $userId = null): array |
||
85 | |||
86 | /** |
||
87 | * You can retrieve unread items and mentions using the following endpoint. |
||
88 | * |
||
89 | * @param string $roomId |
||
90 | * @param string|null $userId |
||
91 | * @return array |
||
92 | * @throws \RuntimeException |
||
93 | * @throws \InvalidArgumentException |
||
94 | * @throws \Throwable |
||
95 | * @throws \Exception |
||
96 | */ |
||
97 | public function unreadItems(string $roomId, string $userId = null): array |
||
104 | |||
105 | /** |
||
106 | * There is an additional endpoint nested under rooms that you can use to mark chat messages as read |
||
107 | * |
||
108 | * @param string $roomId |
||
109 | * @param array $messageIds |
||
110 | * @param string|null $userId |
||
111 | * @return array |
||
112 | * @throws \RuntimeException |
||
113 | * @throws \InvalidArgumentException |
||
114 | * @throws \Throwable |
||
115 | * @throws \Exception |
||
116 | */ |
||
117 | public function markAsRead(string $roomId, array $messageIds, string $userId = null): array |
||
125 | |||
126 | /** |
||
127 | * List of the user's GitHub Organisations and their respective Room if available. |
||
128 | * |
||
129 | * @param string|null $userId |
||
130 | * @return array |
||
131 | * @throws \RuntimeException |
||
132 | * @throws \InvalidArgumentException |
||
133 | * @throws \Throwable |
||
134 | * @throws \Exception |
||
135 | */ |
||
136 | public function orgs(string $userId = null): array |
||
143 | |||
144 | /** |
||
145 | * List of the user's GitHub Repositories and their respective Room if available. |
||
146 | * |
||
147 | * Note: It'll return private repositories if the current user has granted Gitter privileges to access them. |
||
148 | * |
||
149 | * @param string|null $userId |
||
150 | * @return array |
||
151 | * @throws \RuntimeException |
||
152 | * @throws \InvalidArgumentException |
||
153 | * @throws \Throwable |
||
154 | * @throws \Exception |
||
155 | */ |
||
156 | public function repos(string $userId = null): array |
||
163 | |||
164 | /** |
||
165 | * List of Gitter channels nested under the current user. |
||
166 | * |
||
167 | * @param string|null $userId |
||
168 | * @return array |
||
169 | * @throws \RuntimeException |
||
170 | * @throws \InvalidArgumentException |
||
171 | * @throws \Throwable |
||
172 | * @throws \Exception |
||
173 | */ |
||
174 | public function channels(string $userId = null): array |
||
181 | } |
||
182 |