public function shareFile($to, $file)
    {
        $parts[] = [
            'headers' => [
                'Content-Type' => $file['file_type'] ?: 'application/octet-stream',
            ],
            'name' => 'file',
            'contents' => stream_for($file['content']),
            'filename' => $file['filename'] ?: 'untitled',
        ];

        if (! str_empty($file['message'])) {
            $parts[] = [
                'headers' => [
                    'Content-Type' => 'application/json',
                ],
                'name' => 'metadata',
                'contents' => json_encode(['message' => $file['message']]),
            ];
        }

        $url = $this->url.'/v2/room/'.urlencode($to).'/share/file';

        return $this->postMultipartRelated($url, [
            'headers' => $this->getHeaders(),
            'multipart' => $parts,
        ]);
    }