/** * @param CommandInterface $command * * @throw \LogicException * @throw \GuzzleHttp\Exception\RequestException * * @return \GuzzleHttp\Message\ResponseInterface|void */ public function request(CommandInterface $command) { if ($command instanceof UploadFile || $command instanceof UploadNewFileVersion) { return $command->execute($this->uploadClient); } return $command->execute($this->apiClient); }
/** * @param CommandInterface $command * * @throw \LogicException * @throw \GuzzleHttp\Exception\RequestException * * @return \Psr\Http\Message\ResponseInterface|void */ public function request(CommandInterface $command) { if ($command instanceof MultipartDocumentUpload) { return $command->execute($this->uploadClient); } return $command->execute($this->apiClient); }
/** * @param CommandInterface $command * * @throw \LogicException * @throw \GuzzleHttp\Exception\RequestException * * @return \Psr\Http\Message\ResponseInterface|void */ public function request(CommandInterface $command) { try { if ($command instanceof UploadFile || $command instanceof UploadNewFileVersion) { return $command->execute($this->uploadClient); } return $command->execute($this->apiClient); } catch (ClientException $e) { return $e->getResponse(); } catch (RequestException $e) { return $e->getResponse(); } }