protected function execute(InputInterface $input, OutputInterface $output)
 {
     $spaceId = $input->getArgument('space-id');
     $token = $input->getArgument('token');
     $destPath = $input->getArgument('dest-path');
     if (!file_exists($destPath)) {
         throw new \InvalidArgumentException(sprintf("Destination directory '<info>%s</info>' does not exist.", $destPath));
     }
     if (!is_writable($destPath)) {
         throw new \InvalidArgumentException(sprintf("Destination directory '<info>%s</info>' does not have write permissions.", $destPath));
     }
     $generator = $this->getClassGenerator();
     $client = new Client($token, $spaceId);
     $contentTypes = $client->getContentTypes(new Query());
     foreach ($contentTypes as $contentType) {
         $code = $generator->generateEntryClass($contentType);
         file_put_contents($destPath . '/' . $generator->getClassName($contentType) . '.php', $code);
     }
 }