eventBusProxyClient = $eventBusProxyClient; $this->jsonFormatter = $jsonFormatter; } /** * @param string $jobId * @param array $data * @param int $scriptStartTime * * @return array * * @throws EnvVarException */ public function upload($jobId, $data, $scriptStartTime) { $dataJson = $this->jsonFormatter->formatNewlineJsonString($data); try { $response = $this->eventBusProxyClient->upload($jobId, $dataJson, $scriptStartTime); } catch (ClientException $exception) { return ['error' => $exception->getMessage()]; } catch (ConnectException $exception) { return ['error' => $exception->getMessage()]; } return $response; } /** * @param string $jobId * @param array $data * * @return array * * @throws EnvVarException */ public function delete($jobId, $data) { $dataJson = $this->jsonFormatter->formatNewlineJsonString($data); try { $response = $this->eventBusProxyClient->uploadDelete($jobId, $dataJson); } catch (ClientException $exception) { return ['error' => $exception->getMessage()]; } return $response; } }