1 | <?php |
||
17 | class File |
||
18 | { |
||
19 | /** |
||
20 | * @var Client |
||
21 | */ |
||
22 | private $client; |
||
23 | |||
24 | 1 | public function __construct(Client $client) |
|
28 | |||
29 | /** |
||
30 | * Get file |
||
31 | * https://cybozudev.zendesk.com/hc/ja/articles/202166180#step1 |
||
32 | * |
||
33 | * @param string $fileKey |
||
34 | * @param int $guestSpaceId |
||
35 | * @return string |
||
36 | */ |
||
37 | 1 | public function get($fileKey, $guestSpaceId = null) |
|
44 | |||
45 | /** |
||
46 | * Get file stream response |
||
47 | * https://cybozudev.zendesk.com/hc/ja/articles/202166180#step1 |
||
48 | * |
||
49 | * @param string $fileKey |
||
50 | * @param int $guestSpaceId |
||
51 | * @return ResponseInterface |
||
52 | */ |
||
53 | 1 | public function getStreamResponse($fileKey, $guestSpaceId = null) |
|
63 | |||
64 | /** |
||
65 | * @param array $fileKeys |
||
66 | * @param int|null $guestSpaceId |
||
67 | * @return array [contents, contents, ...] The order of $fileKeys |
||
68 | */ |
||
69 | 1 | public function multiGet(array $fileKeys, $guestSpaceId = null) |
|
92 | |||
93 | /** |
||
94 | * Post file |
||
95 | * https://cybozudev.zendesk.com/hc/ja/articles/201941824#step1 |
||
96 | * |
||
97 | * @param string $filename |
||
98 | * @param int $guestSpaceId |
||
99 | * @return string |
||
100 | */ |
||
101 | 2 | public function post($filename, $guestSpaceId = null) |
|
113 | |||
114 | /** |
||
115 | * @param array $fileNames |
||
116 | * @param int|null $guestSpaceId |
||
117 | * @return array [fileKey, fileKey, ...] The order of $fileNames |
||
118 | * @throws \InvalidArgumentException |
||
119 | */ |
||
120 | 1 | public function multiPost(array $fileNames, $guestSpaceId = null) |
|
147 | |||
148 | /** |
||
149 | * Returns locale independent base name of the given path. |
||
150 | * |
||
151 | * @param string $name The new file name |
||
152 | * @return string containing |
||
153 | */ |
||
154 | 12 | public static function getFilename($name) |
|
162 | |||
163 | 3 | private function changeLocale() |
|
170 | |||
171 | /** |
||
172 | * @param string $filename |
||
173 | * @return array |
||
174 | */ |
||
175 | 3 | private static function createMultipart($filename) |
|
184 | } |