protected function getClient()
    {
        if (!($this->client instanceof Client)) {
            $handlerStack = HandlerStack::create();
            $handlerStack = $this->withOAuth2MiddleWare($handlerStack);
            $this->client = new Client([
                'handler' => $handlerStack,
                'auth' => 'oauth2',
                'base_uri' => $this->basepath,
                'headers' => [
                    'Accept' => 'application/json',
                    'Content-type' => 'application/json',
                    'User-Agent' => 'qbank3api-phpwrapper/2 (qbankapi: 1; swagger: 1.1)',
                ],
                'verify' => $this->verifyCertificates,
            ]);

            $this->logger->debug('Guzzle client instantiated.', ['basepath' => $this->basepath]);
        }

        return $this->client;
    }