Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions pydrive2/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ def _GetList(self):
:returns: list -- list of pydrive2.files.GoogleDriveFile.
"""
# Teamdrive support
self['corpus'] = 'DEFAULT'
self['supportsTeamDrives'] = True
self['includeTeamDriveItems'] = True
self['supportsAllDrives'] = True
self['includeItemsFromAllDrives'] = True

try:
self.metadata = self.auth.service.files().list(**dict(self)).execute(
Expand Down Expand Up @@ -245,7 +244,7 @@ def FetchMetadata(self, fields=None, fetch_all=False):
fileId=file_id,
fields=fields,
# Teamdrive support
supportsTeamDrives=True
supportsAllDrives=True
).execute(http=self.http)
except errors.HttpError as error:
raise ApiRequestError(error)
Expand Down Expand Up @@ -376,7 +375,7 @@ def _FilesInsert(self, param=None):
param['body'] = self.GetChanges()

# teamdrive support
param['supportsTeamDrives'] = True
param['supportsAllDrives'] = True

try:
if self.dirty['content']:
Expand All @@ -402,7 +401,7 @@ def _FilesUnTrash(self, param=None):
param['fileId'] = self.metadata.get('id') or self['id']

# Teamdrive support
param['supportsTeamDrives'] = True
param['supportsAllDrives'] = True

try:
self.auth.service.files().untrash(**param).execute(
Expand All @@ -427,7 +426,7 @@ def _FilesTrash(self, param=None):
param['fileId'] = self.metadata.get('id') or self['id']

# Teamdrive support
param['supportsTeamDrives'] = True
param['supportsAllDrives'] = True

try:
self.auth.service.files().trash(**param).execute(
Expand All @@ -453,7 +452,7 @@ def _FilesDelete(self, param=None):
param['fileId'] = self.metadata.get('id') or self['id']

# Teamdrive support
param['supportsTeamDrives'] = True
param['supportsAllDrives'] = True

try:
self.auth.service.files().delete(**param).execute(http=self.http)
Expand All @@ -477,7 +476,7 @@ def _FilesUpdate(self, param=None):
param['fileId'] = self.metadata.get('id')

# Teamdrive support
param['supportsTeamDrives'] = True
param['supportsAllDrives'] = True

try:
if self.dirty['content']:
Expand Down Expand Up @@ -506,7 +505,7 @@ def _FilesPatch(self, param=None):
param['fileId'] = self.metadata.get('id')

# Teamdrive support
param['supportsTeamDrives'] = True
param['supportsAllDrives'] = True

try:
metadata = self.auth.service.files().patch(**param).execute(
Expand Down