1 | <?php |
||
7 | class Transfers |
||
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 active transfers. |
||
23 | * If transfer is completed, it is removed from the list. |
||
24 | * |
||
25 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
26 | * |
||
27 | * @see https://api.put.io/v2/docs/transfers.html#get--transfers-list |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | public function list() |
||
35 | |||
36 | /** |
||
37 | * Adds a new transfer. |
||
38 | * |
||
39 | * @param string $url |
||
40 | * @param int $save_parent_id |
||
41 | * @param string $callback_url |
||
42 | * |
||
43 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
44 | * |
||
45 | * @see https://api.put.io/v2/docs/transfers.html#post--transfers-add |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function add(string $url, int $save_parent_id = 0, string $callback_url = '') |
||
55 | |||
56 | /** |
||
57 | * Returns a transfer’s properties. |
||
58 | * |
||
59 | * @param int $id |
||
60 | * |
||
61 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
62 | * |
||
63 | * @see https://api.put.io/v2/docs/transfers.html#get--transfers--id- |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | public function get(int $id) |
||
71 | |||
72 | /** |
||
73 | * Retry previously failed transfer. |
||
74 | * |
||
75 | * @param int $id |
||
76 | * |
||
77 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
78 | * |
||
79 | * @see https://api.put.io/v2/docs/transfers.html#retry |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function retry(int $id) |
||
89 | |||
90 | /** |
||
91 | * Deletes the given transfers. |
||
92 | * |
||
93 | * @param array $transfer_ids |
||
94 | * |
||
95 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
96 | * |
||
97 | * @see https://api.put.io/v2/docs/transfers.html#cancel |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public function cancel(array $transfer_ids = []) |
||
107 | |||
108 | /** |
||
109 | * Clean completed transfers from the list. |
||
110 | * |
||
111 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
112 | * |
||
113 | * @see https://api.put.io/v2/docs/transfers.html#clean |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | public function clean() |
||
121 | } |
||
122 |