(self)
return rendered_files
Returns a dictionary containing for each spec file the list of rendered models
Returns a dictionary containing for each spec file the list of rendered models
Returns a dictionary containing for each spec file the list of rendered models
def render(self) -> Dict[str, Dict[str, str]]:
        """
        Returns a dictionary containing for each spec file the list of rendered models
        """
        # { spec_file_name: {model_file_name: model_file_contents }
        rendered_files = {}

        for spec_file in self.spec['files']:
            # (<file name>, (<contents>, <errors>))
            model_files: Dict[str, Tuple[str, List[str]]] = {}
            # Contains pairs of model_id and schema_name. eg ('instance', 'InstanceConfig')
            package_info: List[Tuple[str, str]] = []
            model_info = ModelInfo()

            # Sections are init_config and instances
            for section in sorted(spec_file['options'], key=lambda s: s['name']):
                (
                    section_package_info,
                    section_model_files,
                    section_model_info,
                ) = self._process_section(section)
                package_info.extend(section_package_info)
                model_files.update(section_model_files)
                model_info.update(section_model_info)

            # Logs-only integrations
            if not model_files:
                continue

            model_files.update(self._build_model_files(model_info, package_info))
            rendered_files[spec_file['name']] = {file_name: model_files[file_name] for file_name in sorted(model_files)}

        return rendered_files
def render ( self ) -> Dict [ str , Dict [ str , str ] ] : # { spec_file_name: {model_file_name: model_file_contents } rendered_files = { } for spec_file in self . spec [ 'files' ] : # (<file name>, (<contents>, <errors>)) model_files : Dict [ str , Tuple [ str , List [ str ] ] ] = { } # Contains pairs of model_id and schema_name. eg ('instance', 'InstanceConfig') package_info : List [ Tuple [ str , str ] ] = [ ] model_info = ModelInfo ( ) # Sections are init_config and instances for section in sorted ( spec_file [ 'options' ] , key = lambda s : s [ 'name' ] ) : ( section_package_info , section_model_files , section_model_info , ) = self . _process_section ( section ) package_info . extend ( section_package_info ) model_files . update ( section_model_files ) model_info . update ( section_model_info ) # Logs-only integrations if not model_files : continue model_files . update ( self . _build_model_files ( model_info , package_info ) ) rendered_files [ spec_file [ 'name' ] ] = { file_name : model_files [ file_name ] for file_name in sorted ( model_files ) } return rendered_files