'Build the data structure representing the config.'

def Handle(self, unused_args, token=None):

    sections = {}
    for descriptor in config.CONFIG.type_infos:
        if (descriptor.section in sections):
            continue
        section_data = {}
        for parameter in self._ListParametersInSection(descriptor.section):
            section_data[parameter] = ApiConfigOption().InitFromConfigOption(parameter)
        sections[descriptor.section] = section_data
    result = ApiGetConfigResult()
    for section_name in sorted(sections):
        section = sections[section_name]
        api_section = ApiConfigSection(name=section_name)
        api_section.options = []
        for param_name in sorted(section):
            api_section.options.append(section[param_name])
        result.sections.append(api_section)
    return result
