1 | <?php |
||
7 | class Friends |
||
8 | { |
||
9 | /** |
||
10 | * The Http Client. |
||
11 | * |
||
12 | * @var \Mozammil\Putio\Http\Client |
||
13 | */ |
||
14 | protected $client; |
||
15 | |||
16 | public function __construct(Client $client) |
||
20 | |||
21 | /** |
||
22 | * Lists friends. |
||
23 | * |
||
24 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
25 | * |
||
26 | * @see https://api.put.io/v2/docs/friends.html#get--friends-list |
||
27 | * |
||
28 | * @return string |
||
29 | */ |
||
30 | public function list() |
||
34 | |||
35 | /** |
||
36 | * Lists incoming friend requests. |
||
37 | * |
||
38 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
39 | * |
||
40 | * @see https://api.put.io/v2/docs/friends.html#get--friends-waiting-requests |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | public function requests() |
||
48 | |||
49 | /** |
||
50 | * Sends a friend request to the given username. |
||
51 | * |
||
52 | * @param string $username |
||
53 | * |
||
54 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
55 | * |
||
56 | * @see https://api.put.io/v2/docs/friends.html#send-request |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | public function sendRequest(string $username) |
||
64 | |||
65 | /** |
||
66 | * Approves a friend request from the given username. |
||
67 | * |
||
68 | * @param string $username |
||
69 | * |
||
70 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
71 | * |
||
72 | * @see https://api.put.io/v2/docs/friends.html#approve |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | public function approveRequest(string $username) |
||
80 | |||
81 | /** |
||
82 | * Denies a friend request from the given username. |
||
83 | * |
||
84 | * @param string $username |
||
85 | * |
||
86 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
87 | * |
||
88 | * @see https://api.put.io/v2/docs/friends.html#post--friends--username--deny |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function denyRequest(string $username) |
||
96 | |||
97 | /** |
||
98 | * Removes friend from friend list. |
||
99 | * Files shared with all friends will be automatically |
||
100 | * removed from old friend’s directory. |
||
101 | * |
||
102 | * @param string $username |
||
103 | * |
||
104 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
105 | * |
||
106 | * @see https://api.put.io/v2/docs/friends.html#unfriend |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function unfriend(string $username) |
||
114 | } |
||
115 |