pygsheets icon indicating copy to clipboard operation
pygsheets copied to clipboard

Update team drive api params

Open nithinmurali opened this issue 3 years ago • 1 comments
trafficstars

The files api has added new params for teamDrives and has deprecated old ones. With this change we are migrating to the new ones.

This should also solve the issue mentioned in https://github.com/nithinmurali/pygsheets/pull/556 @thuibr Please confirm.

nithinmurali avatar Sep 11 '22 16:09 nithinmurali

Hi, I receive this error:

>>> client.drive.create_folder('test folder', folder='XXXX')
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
  File "/opt/project/src/pygsheets/pygsheets/drive.py", line 124, in create_folder
    return self._execute_request(self.service.files().create(body=body, supportsAllDrives=self.is_team_drive(),
  File "/usr/local/lib/python3.9/site-packages/googleapiclient/discovery.py", line 997, in method
    raise TypeError('Got an unexpected keyword argument {}'.format(name))
TypeError: Got an unexpected keyword argument supportsAllDrives
>>> 

This is with google-api-python-client 2.20.0 and google-auth-oauthlib 0.5.0.

thuibr avatar Sep 13 '22 14:09 thuibr

Updated the local discovery document with latest specs. It should work now.

nithinmurali avatar Sep 25 '22 17:09 nithinmurali

Sorry for the really late reply. This PR does work now.

thuibr avatar Nov 07 '22 19:11 thuibr