I am trying to migrate the Google Drive files of an account "xxxxxxxx@gmail.com" to another Google Workspace account "xxxxxxx@mycompany.com"
What is the best way to achieve this and maintain all the metadata of the original file ?
metadata = shared users and folder structure.
You will need to do a file.list to list all of the files in your current drive account.
Then you will need to do a file.get on each of the files.  The main issue will be the file metadata.  As not all file metadata is writeable which means if you do a pure file.get with fields = * you will have a problem using that metadata for the file.create on the workspace account.
You will need to go though each of the metadata items and remove the ones that are not writeable so that you can upload them.
Migrate/Move Google Drive files to new organization account