def create_http_function_view_model(http_function): function_view_model = { "id": http_function['id'], "user_id": http_function['user_id'], "name": http_function['name'], "path": http_function['path'], "description": http_function['description'], "runtime": http_function['runtime'], "script_content": http_function['script_content'], "invoked_count": http_function['invoked_count'], "environment_info": http_function['environment_info'], "is_public": http_function['is_public'], "log_request": http_function['log_request'], "log_response": http_function['log_response'], "version_number": http_function['version_number'] } return function_view_model def create_http_functions_view_model(http_functions): view_model = [] for function in http_functions: function_view_model = create_http_function_view_model(function) view_model.append(function_view_model) return view_model