def write_to_file(self, file_path: str) -> None:
data = self.encode()<EOL>with open(file_path, "<STR_LIT:w>") as f:<EOL><INDENT>json.dump(data, f, indent=<NUM_LIT:1>)<EOL><DEDENT>
Serialize and write the data into a JSON file.