getStatusCode()); $this->request = $request; $this->response = $response; } /** * Returns the HTTP request */ public function getHttpRequest(): HttpRequest { return $this->request; } /** * Returns the HTTP response */ public function getHttpResponse(): ?HttpResponse { return $this->response; } /** * Is the response available? */ public function hasResponse(): bool { return !\is_null($this->response); } /** * Converts the ApiException object to a human-readable string representation. * * @return string The string representation of the ApiException object. */ public function __toString(): string { return ApiHelper::stringify( 'ApiException', [ 'statusCode' => $this->getCode(), 'message' => $this->getMessage() ] ); } }