def _GenApiConfigCallback(args, api_func=GenApiConfig):
service_configs = api_func(args.service,<EOL>hostname=args.hostname,<EOL>application_path=args.application)<EOL>for api_name_version, config in service_configs.items():<EOL><INDENT>_WriteFile(args.output, api_name_version + '<STR_LIT>', config)<EOL><DEDENT>
Generate an api file.

    Args:
      args: An argparse.Namespace object to extract parameters from.
      api_func: A function that generates and returns an API configuration
        for a list of services.