def generate(self, api):
rsrc_folder = os.path.join(os.path.dirname(__file__), '<STR_LIT>')<EOL>rsrc_output_folder = os.path.join(self.target_folder_path, '<STR_LIT>')<EOL>if not os.path.exists(rsrc_output_folder):<EOL><INDENT>os.makedirs(rsrc_output_folder)<EOL><DEDENT>self.logger.info('<STR_LIT>')<EOL>shutil.copy(<EOL>os.path.join(rsrc_folder, '<STR_LIT>'),<EOL>rsrc_output_folder)<EOL>shutil.copy(<EOL>os.path.join(rsrc_folder, '<STR_LIT>'),<EOL>rsrc_output_folder)<EOL>self.logger.info('<STR_LIT>')<EOL>shutil.copy(<EOL>os.path.join(rsrc_folder, '<STR_LIT>'),<EOL>rsrc_output_folder)<EOL>shutil.copy(<EOL>os.path.join(rsrc_folder, '<STR_LIT>'),<EOL>rsrc_output_folder)<EOL>self.logger.info('<STR_LIT>')<EOL>shutil.copy(<EOL>os.path.join(rsrc_folder, '<STR_LIT>'), rsrc_output_folder)<EOL>shutil.copy(<EOL>os.path.join(rsrc_folder, '<STR_LIT>'), rsrc_output_folder)<EOL>self.logger.info('<STR_LIT>')<EOL>shutil.copy(<EOL>os.path.join(rsrc_folder, '<STR_LIT>'),<EOL>rsrc_output_folder)<EOL>jazzy_cfg = None<EOL>if self.args.documentation:<EOL><INDENT>jazzy_cfg_path = os.path.join('<STR_LIT>', '<STR_LIT>')<EOL>with open(jazzy_cfg_path) as jazzy_file:<EOL><INDENT>jazzy_cfg = json.load(jazzy_file)<EOL><DEDENT>for idx, namespace in enumerate(api.namespaces.values()):<EOL><INDENT>ns_name = fmt_public_name(namespace.name)<EOL>ns_dict = {"<STR_LIT:name>": ns_name, "<STR_LIT>": [], }<EOL>jazzy_cfg['<STR_LIT>'].insert(idx, ns_dict)<EOL><DEDENT><DEDENT>for namespace in api.namespaces.values():<EOL><INDENT>self.namespace_to_has_route_auth_list[namespace] = set()<EOL>if namespace.routes:<EOL><INDENT>for route in namespace.routes:<EOL><INDENT>if route.attrs.get('<STR_LIT>') != '<STR_LIT>':<EOL><INDENT>self.namespace_to_has_route_auth_list[namespace].add(<EOL>route.attrs.get('<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>self.namespace_to_has_route_auth_list[namespace].add(<EOL>'<STR_LIT:user>')<EOL><DEDENT><DEDENT><DEDENT><DEDENT>with self.output_to_relative_path('<STR_LIT>'):<EOL><INDENT>self._generate_all_imports(api)<EOL><DEDENT>for namespace in api.namespaces.values():<EOL><INDENT>for data_type in namespace.linearize_data_types():<EOL><INDENT>self.obj_name_to_namespace[data_type.name] = fmt_class_prefix(<EOL>data_type)<EOL><DEDENT><DEDENT>for namespace in api.namespaces.values():<EOL><INDENT>ns_name = fmt_public_name(namespace.name)<EOL>self._generate_namespace_types(namespace, jazzy_cfg)<EOL>if namespace.routes:<EOL><INDENT>if self.args.documentation:<EOL><INDENT>for auth_type in self.namespace_to_has_route_auth_list[<EOL>namespace]:<EOL><INDENT>append_to_jazzy_category_dict(<EOL>jazzy_cfg, '<STR_LIT>', fmt_routes_class(ns_name, auth_type))<EOL><DEDENT>append_to_jazzy_category_dict(<EOL>jazzy_cfg, '<STR_LIT>', fmt_route_obj_class(ns_name))<EOL><DEDENT>self._generate_route_objects_m(api.route_schema, namespace)<EOL>self._generate_route_objects_h(api.route_schema, namespace)<EOL><DEDENT><DEDENT>if self.args.documentation:<EOL><INDENT>with self.output_to_relative_path('<STR_LIT>'):<EOL><INDENT>self.emit_raw(json.dumps(jazzy_cfg, indent=<NUM_LIT:2>) + '<STR_LIT:\n>')<EOL><DEDENT><DEDENT>
Generates a module for each namespace.

Each namespace will have Obj C classes to represent data types and
routes in the Stone spec.