def METHOD_NAME(items, class_name, install_dir, output_scope):
    namespaces = output_scope.split("::")
    file_name = "%s.h" % class_name
    output_file = os.path.join(install_dir, file_name)
    with open(output_file, "w+") as outf:
        outf.write("// Copyright 2015-present Facebook. All Rights Reserved.\n")
        outf.write("// ** AUTOGENERATED FILE. DO NOT HAND-EDIT **\n\n")
        outf.write("#pragma once\n\n")
        outf.write("#include <string>\n\n")
        for ns in namespaces:
            outf.write("namespace %s { " % ns)
        outf.write("\n\n")
        # generate enum class
        outf.write("enum class %s {\n" % class_name)
        for item in items:
            outf.write("    %s,\n" % item[0])
        outf.write("};\n\n")
        # enum to string convert function
        outf.write(
            "extern const std::string& get%sString(%s);\n" % (class_name, class_name)
        )
        outf.write(
            "extern %s get%sFromString(const std::string&);\n"
            % (class_name, class_name)
        )
        for _ in namespaces:
            outf.write("}")
        outf.write("\n\n")