problem with InsertPermission() optional parameters: sendNotificationEmails=False is not working
sagarsharma19 opened this issue · comments
I am trying to insert optional parameter sendNotificationEmails=False
to InsertPermission
, but getting an error.
Code Snippet :
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
gauth.LoadCredentialsFile("mycreds.txt")
drive = GoogleDrive(gauth)
params = {'sendNotificationEmails' = False}
gfile = drive.CreateFile({'parents': [{'id': 'SomeID'}]})
gfile.SetContentFile(file)
gfile.Upload()
gfile.InsertPermission({'type': 'user','value': 'email','role': 'writer'},params)
** Error message :**
InsertPermission() takes 2 positional arguments but 3 were given
@sagarsharma19 params = {'sendNotificationEmails' = False}
doesn't look like a valid Python code to me?
Assuming that you are actually using params = {'sendNotificationEmails': False}
, could you check what version of PyDrive2 you use? It might be outdated
@shcheklein sorry for the typo , I was using params = {'sendNotificationEmails': False} only . I upgraded the version and then tried it worked fine.
Thank you so much for your guidance.