api = $apiClient; $this->app = new App($this); $this->brancherApp = new BrancherApp($this); $this->settings = new Settings($this); $this->logbook = new Logbook($this); } public function getJsonFromResponse(ResponseInterface $response) { return json_decode((string)$response->getBody(), true, JSON_THROW_ON_ERROR); } public function maybeThrowApiExceptions(ResponseInterface $response) { if ($response->getStatusCode() >= 500) { throw new HypernodeApiServerException($response); } if ($response->getStatusCode() >= 400) { throw new HypernodeApiClientException($response); } } }