API = $API; $this->session = $API->wrapper->getSession()->getSessionDirectoryPath(); } /** @internal */ public function __sleep() { $vars = \get_object_vars($this); unset($vars['API']); return \array_keys($vars); } /** @internal */ public function __wakeup(): void { $this->API = Client::giveInstanceBySession($this->session); } }