| @@ 56-67 (lines=12) @@ | ||
| 53 | return json_decode($response->getBody(), true); |
|
| 54 | } |
|
| 55 | ||
| 56 | public function delete(string $path): array |
|
| 57 | { |
|
| 58 | $path = $this->normalizePath($path); |
|
| 59 | ||
| 60 | $response = $this->client->post('files/delete', [ |
|
| 61 | 'json' => [ |
|
| 62 | 'path' => $path, |
|
| 63 | ] |
|
| 64 | ]); |
|
| 65 | ||
| 66 | return json_decode($response->getBody(), true); |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * @param string $path |
|
| @@ 105-118 (lines=14) @@ | ||
| 102 | return json_decode($response->getBody(), true); |
|
| 103 | } |
|
| 104 | ||
| 105 | public function getTemporaryLink(string $path): string |
|
| 106 | { |
|
| 107 | $path = $this->normalizePath($path); |
|
| 108 | ||
| 109 | $response = $this->client->post('files/get_temporary_link', [ |
|
| 110 | 'json' => [ |
|
| 111 | 'path' => $path, |
|
| 112 | ], |
|
| 113 | ]); |
|
| 114 | ||
| 115 | $body = json_decode($response->getBody(), true); |
|
| 116 | ||
| 117 | return $body['link']; |
|
| 118 | } |
|
| 119 | ||
| 120 | public function getThumbnail(string $path, string $format = 'jpeg', string $size = 'w64h64'): string |
|
| 121 | { |
|