def METHOD_NAME(
    value: Any,
    path: Union[str, Path],
    file_format: str,
) -> None:
    if file_format == SerializationFormats.PICKLE:
        with open(path, 'wb') as f:
            pickle.dump(value, f)
    elif file_format == SerializationFormats.JSON:
        with open(path, 'w') as f:
            json.dump(value, f)
    elif file_format == SerializationFormats.TEXT:
        with open(path, 'w') as f:
            f.write(value)
    else:
        raise ValueError(f"Invalid format {file_format}")